Home >>Python Programs >Python Program to Check Odd or Even
In this example, we will see a Python program to check if any given input number is odd or even. If a number is divided by 2 and it gives a remainder of 0 then it is known as even number, otherwise an odd number. 2,4,6, etc are known as even numbers while 1,3,5,7, etc are known as odd numbers.
Example :
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even number".format(num))
else:
print("{0} is Odd number".format(num))