Python program that reads an integer and determines and prints whether it’s odd or even

Here is code for a python program that reads an integer and determines and prints whether it’s odd or even.


# Python program that reads an integer and determines and prints whether it’s odd or even

userInput = int(input("Enter the number: "))
if a % 2 == 0:
    print(userInput, "is even.")
else:
    print(userInput, "is odd.")

# This code is contributed by Ahmad Shafiq

callout-flag

Love this read? Subscribe to Modernage!

Do you have any queries? You can ask in the comments. We, at Modernage answer each and every question, asked in the comments, so If you have any queries, or you want to know about any specific platform you can ask in the comments below

Author

Leave a Reply

girl-carrying-document

More Articles.

girl-carrying-document

More Articles.