Home  >  Article  >  Backend Development  >  What does float mean in python?

What does float mean in python?

尚
Original
2019-06-26 16:28:2395626browse

What does float mean in python?

Description

Number type: float(floating point)

Function: float()

The float() function is used to convert integers and strings into floating point numbers.

float() syntax:

class float([x])

Parameters:

x -- integer or string

Return value:

Return floating point number

Example:

>>>float(1)1.0
>>> float(112)112.0
>>> float(-123.6)
-123.6
>>> float('123')     # 字符串
123.0

For more Python related technical articles, please visit the Python Tutorial column study!

The above is the detailed content of What does float mean in python?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn