Answer to Question #314144 in Python for junior

Question #314144

Write a program that reads an integer and determines and prints whether it is odd or event. [Hint: Use the remainder operator. An even number is a multiple of two. Any multiple of two leaves a remainder of zero when divided by 2.].


1
Expert's answer
2022-03-19T19:25:44-0400
number = float(input("input number: "))
if(number % 2 == 0):
    print("the number is even")
else:
    print("the number is odd")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS