Write a program to check if a number is even or odd.
num = int(input("Enter a number: "))
if num % 2 == 0:
print("Even")
else:
print("Odd")
note
To compile and run the program, you can use the following commands:
python3 foo.py
Write a program to check if a number is even or odd.
num = int(input("Enter a number: "))
if num % 2 == 0:
print("Even")
else:
print("Odd")
To compile and run the program, you can use the following commands:
python3 foo.py