Home Browser Contributors

Float (float)

Aa Float is a type of value used in Python. A float is used to represent a number with decimals. The Float type is referred to as float internally in Python. Floats are typed as you would type a number anywhere else.

Example

Here is an example of a float:

``` py 3.14159 ```

You can also convert another value to a float (provided it can represent a number), this example is of a string with a number of the user's choice:

``` py userInput = input("Please enter a number with a decimal: ") inputtedFloat = float(userInput) ```