Write a Python program that asks for an integer from the user and checks if the number is even or odd. Print out an appropriate message to the console.
Example:
Input: 5
Output: "Odd"
Input: 10
Output: "Even"
Remember the modulus operation in Python. The modulus of a number by 2 can help determine if a number is even or odd.
num = int(input("Enter a number: "))
if num % 2 == 0:
print(f"The number {num} is even.")
else:
print(f"The number {num} is odd.")
NOTEOwing to browser caching, any code input into the Trinket IDE might carry over across page refreshes or when transitioning between different questions. To commence with a clean slate, either click on the 'Reset Button' found within the IDE's Hamburger icon (☰) menu or resort to using Chrome's Incognito Mode.