A number is said to be even if it is divisible by 2, hence we use the modulo % operation to check for the same num = int(input("Enter a number")) if num % 2 == 0: print("Even") else: print("Odd")