Check Even Odd Program in Python
Here you will get the example code to check even odd program in Python programming.
Rule to Check Odd or Even Number:-
If a number is completely divided by 2 and the remainder is 0, then number is even otherwise number is odd.
Example Code to Check Even Odd Program in Python
1 2 3 4 5 6 7 8 | #Python Program to Check odd or even numbers num = int(input("Enter a number: ")) # If number is divisible by 2 then it is even if (num % 2) == 0: print("{0} is Even".format(num)) else: print("{0} is Odd".format(num)) |
Output 1
Enter a number: 5
5 is Odd
Output 2
Enter a number: 4
4 is Even
Check out our other Python Programming Examples