what is python float ?

Register or Login to View the Solution or Ask a Question

Python float :

In python, a real number is called float. A real number is number lying between -infinity and +infinity. A real numbers can be a fractional number or a decimal number or an integer.

Examples:

-1/3, 5, 0, 0.65, -3.14, √2

# Python program to identity an integer
n1=0.5
n2=-3.14 
n3=10/3 
print(n1, "has a float type")
print(n2,  "has a float type")
print(n3,  "has a float type")

Output :

0.5 has a float type

-3.14 has a float type

3.3333333333333335 has a float type.


Register or Login to View the Solution or Ask a Question

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply