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
- Take any number of your choice as input.
- Check the type of the input number by using type().
- Check whether the given number is an integer or not using an if-else statement.
- Print the output.
num1 = 54
if type(num1) == int:
print("True")
else:
print("False")
Output :
True
Related Articles
Python program to check whether the given number is float or not.
Python program to check whether the given input is a string or not.
Python program to print all the numbers from 10-15 except 13.
Python program to find the electricity bill. According to the following conditions:
Python program to check whether a given year is a leap or not.