Check whether the number is an integer or not.

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

An Integer is a whole number, which includes negative numbers, positive numbers, and zero. Integers don’t include any fractions or rational parts

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 an integer or not using an if-else statement.
  4. Print the output.
				
					num1 = 54

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

Output :

				
					True
				
			

Related Articles

check whether the given character is lowercase or not.

check whether the given number is float or not.

Leave a Comment