Check Given number add or even

add or even


Hi Friends...
Welcome today...
I coded for given number is odd or even
It is very simplest program compared to previous coded.
okay let's start...


CODE:

try:
    a = int(input('Enter any number: '))
    if a > 0:
        if a % 2 == 0:
            print(f'{a} is a even number')
        else:
            print(f'{a} is a odd number')
except:
    print('Invalid input')


----


By
PyKAR

Comments

Popular posts from this blog

Hardy - Ramanujan Number (Magic Number) Program in Python

FLAMES CODE ON PYTHON

Count Swap for Sorting in Python