Python float() class

The float() class in Python returns a floating point number constructed from a number or string x.

Syntax

Parameter

x: This parameter represents a number or a string that can be converted into a floating point number

Return

This function returns a floating point number.

Example 1

Output

Example 2

Output

Example 3

Output

Pin It on Pinterest

Share This