#to know if a given number is even or odd. x = int(input("Enter a number: ")) if x%2==0: print(x, " is even number.") else: print(x, " is odd number.") OUTPUT: Enter a number: 8 8 is even number.
A Python program to accept a number from the keyboard and test whether it is even or odd.
#to know if a given number is even or odd. x = int(input("Enter a number: ")) if x%2==0: print(x, " is even number.") else: print(x, " is odd number.") OUTPUT: Enter a number: 8 8 is even number.