A Python program to test whether a number is even or odd.

#to know if a given number is even or odd.
x = 10
if x%2==0:
    print(x, " is even number.")
else:
    print(x, " is odd number.")

OUTPUT:
10  is even number.

Related Examples

1. A python program to calculate the area of a circle.

2. A Python program to accept a number from the keyboard and test whether it is even or odd.

3. A Python program to check whether a given number is in between 1 and 10.

4. A Python program to display and sum of a list of numbers using while loop.

Leave a Reply

Your email address will not be published. Required fields are marked *

Wordpress Social Share Plugin powered by Ultimatelysocial
Wordpress Social Share Plugin powered by Ultimatelysocial