208k views
2 votes
Write a program that reads an integer and determines and prints whether it is odd or even.

User Jake Ols
by
8.3k points

1 Answer

6 votes

num = int(input("Enter a number: "))

print(str(num)+" is even" if num % 2 == 0 else str(num)+" is odd")

I wrote my code in python 3.8. Best of luck.

User Mrkiffie
by
8.7k points

No related questions found