1# Python program to check if the input number is odd or even.
2# A number is even if division by 2 gives a remainder of 0.
3# If the remainder is 1, it is an odd number.
4
5num = int(input("Enter a number: "))
6if (num % 2) == 0:
7 print("{0} is Even".format(num))
8else:
9 print("{0} is Odd".format(num))
1num = int(input("Enter a Number:"))
2if num % 2 == 0:
3 print(num , "is even")
4else:
5 print(num , "is odd")
1number = int(input("Write a number:- "))
2if number%2 == 0:
3 print("Even number")
4else:
5 print("odd number")
1n = int(input("Enter a number: "))
2print(n,"is Even.") if (n % 2) == 0 else print(n,"is Odd.")
1mynumber = int(input("Enter number")) # Ask an integer number to the user
2if mynumber % 2 == 0: # % = modelo, It is equal to the rest of the division
3 print(mynumber, "is an even number")
4else: # The rest of 7 / 2 is 2.5, not 0
5 print(mynumber, "is an odd number")