Write a Python program to find whether a given number (accept from the user) is even or odd, print out an appropriate message to the user

Introduction
Here we are writing a program to find whether a given number is even or odd.

PROGRAM
----------------------------------------------
num = int(input("Enter a number: "))
mod = num % 2
if mod > 0:
    print("This is an odd number.")
else:
    print("This is an even number.")
----------------------------------------------
RESULTS : 

Enter a number: 5                                                                                             
This is an odd number.

Comments