Overview:
- The built-in function float() creates a floating point number from integer, floating point and string values.
- The function exposed as the built-in function is the constructor of the class float.
Example:
# Example Python program that uses built-in # Create a floating point number from an integer # Create a floating point number from a string # Add (upto) 1e291 beyond the maximum value supported by the system # No effect # Add 1e292 beyond the maximum value supported by the system # Results an inf # Create floating point values from Unicode Characters # From Thai version of 1.2 # From Arabic-Indic version of 1.3 # From Devanagari version of 1.4 # From Mongolian version of 1.5
|
Output:
10.0 |