Python program to check given number is odd or even.

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

Odd number:
Odd numbers are those numbers that cannot be divided into two equal parts.


Even number:
even numbers are those numbers that can be divided into two equal parts.

Steps to solve the program
  1. Take the number as input through the user.
  2. Using an if-else statement check whether the given number is odd or even.
  3. If the number is divisible by 2 then it is even else odd.
  4. Print respective output.
				
					# Take input through the user
num =  int(input("Enter a number: "))
# Check for odd and even number
if num%2 == 0:
# Print output
    print("It is an even number")
else:
#Print output
    print("It is an odd number")
				
			

Output :

				
					Enter a number: 23
It is an odd number
				
			

Related Articles

check given number is a prime number or not.

check a given number is part of the Fibonacci series from 1 to 10.

Leave a Comment