Home >>Python Built-in Functions >Python float() Function
Python float() function is used to convert the given input value into a floating point number. It accepts only one parameter and that is also optional to use.
Syntax:float(value)
Parameter | Description |
---|---|
value | This parameter defines a number or a string that can be converted into a floating point number. |
x = float(5)
print(x)
x = float("9.540")
print(x)