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.0Copy after loginFor 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!