Python Program to find whether an integer is even or odd number

we will develop a simple logic to check whether an integer is even or odd number. Any number( positive/negative ) which is divisible by number 2 is declared as an even number and numbers( positive/negative ) which are not divisible by number 2 are declared as odd numbers.

Python Program to find whether an integer is even or odd number


input_num = int(input('Enter any number: '))
if input_num % 2 == 0:
print(input_num, "is EVEN")
else:
print(input_num, "is ODD")


Output : Test Case : Positive even number

Python Program to find whether an integer is even or odd number

Post a Comment