In this article, we will show you, How to write a Python Program to check if a Number is Odd or Even using If Statement with example.

As we all know, If the number is divisible by 2 then we called it as even number, and remaining (not divisible by 2) are called as odd numbers.

In Python, we have an Arithmetic Operator called % (Modulus) to see the remainder. Let’s use this operator, if the remainder is 0 then the number is even, else odd number.

## Python Program to check if a Number is Odd or Even

This Python program allows the user to enter any integer, and checks whether that number is even or odd using If statement

# Python Program to check if a Number is Odd or Even number = int(input(" Please Enter any Integer Value : ")) if(number % 2 == 0): print("{0} is an Even Number".format(number)) else: print("{0} is an Odd Number".format(number))

**ANALYSIS**

Below statement ask user to Enter any integer value.

number = int(input(" Please Enter any Integer Value : "))

In the Next line, We declared the If statement

Number that is completely divisible 2 is even number. If condition will check the same

- If the condition is True then it is an Even number
- If the condition is False then it is an Odd number

**OUTPUT**

Let me enter second value to check for the even number

## Python Program to check if a Number is Odd or Even Example 2

In this example, we are using the if statement in single line

# Python Program to check if a Number is Odd or Even number = int(input(" Please Enter any Integer Value : ")) print("{0} is an Even Number".format(number)) if(number % 2 == 0) else print("{0} is an Odd Number".format(number))

**OUTPUT**