Write a simple program to accept a value from the user & display whether it is even or odd.
This question is from python program
Sub: Computer
Share
Write a simple program to accept a value from the user & display whether it is even or odd.
This question is from python program
Sub: Computer
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Verified answer
Explanation:
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even number".format(num))
else:
print("{0} is Odd number".format(num))