Program to check whether the number is float

In this python if else program, we will check whether the given number is float or not.

A float is a floating-point number, which means it is a number that has a decimal place. Floats are used when more precision is needed.

Steps to solve the program
  1. Take any number of your choice as input.
  2. Check the type of the input number by using type().
  3. Check whether the given number is float or not using an if-else statement.
  4. Print the output.
				
					num1 = 12.6

if type(num1) == float:
    print("True")
else:
    print("False")
				
			

Output :

				
					True
				
			

Related Articles

check whether the given number is an integer or not.

check whether the given input is a string or not.

Leave a Comment