Python Program to check if a Number is Even or Odd

Python Program to check if a Number is Even or Odd

How can we check even or odd number in Python? Here we are using modulus operator to check and "print" method to print the result.

Even or odd in Python :



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

if(number % 2 == 0):
    print("%d is an Even Number"%(number))
else:
    print("%d is an Odd Number"%(number))
  

Output :