def check_even_odd(number):
if number % 2 == 0:
print(f"The number {number} is even.")
else:
print(f"The number {number} is odd.")
# Example usage
num = int(input("Enter a number: "))
check_even_odd(num)
In this program, we define a function check_even_odd that takes a number as input. It uses the modulus operator (%) to check if the remainder of dividing the number by 2 is equal to 0. If it is, the number is even; otherwise, it is odd.
We then prompt the user to enter a number using the input function, convert it to an integer using int(), and pass it to the check_even_odd function to determine if it's even or odd. The program then prints the appropriate message based on the result.