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

Q. Write a Python program to to check if a given number is a even number or odd number.

What is even and odd number? If a number is divided by 2 and remainder is 0, then the given number is even number, else the number is a odd number.

Even numbers are – 2, 4, 6, 8, 10 …

Odd numbers are – 1, 3, 5, 7, 9 …

## Example

An example to check if given number is even number of odd number in Python.

1 2 3 4 5 6 | num = int(input("Enter a number: ")) if (num % 2) == 0: print(num, "is Even number") else: print(num, "is Odd number") |

Execute above program, input a number see the result:

Enter a number: 7 7 is Odd number

Again execute and input other number.

Enter a number: 6 6 is Even number