Monday, 26 September 2016

Python Odd/Even Program

Program to check that the no. entered by user is odd/even. 

while(True):
    num = raw_input("Enter the number that you want to test for even/odd:\n")
    num = int(num)
    even_odd = num % 2
    if even_odd == 0:
        print "\n\nYour entered number is Even\n\n"
    else:
        print "\n\nYour entered number is Odd\n\n"


OUTPUT:


No comments:

Post a Comment