In the below program – we are creating a function named "CheckEvenOdd()", it accepts a number and returns "EVEN" if the number is EVEN or returns "ODD" if the number is ODD.
# Python function to check EVEN or ODD
def CheckEvenOdd(num):
if (num % 2 == 0):
print(num," is EVEN")
else:
print(num," is ODD")
# main code
CheckEvenOdd(11)
CheckEvenOdd(22)
CheckEvenOdd(33)
CheckEvenOdd(44)
In the below program – we are creating a function named "CheckEvenOdd()", it accepts a number and returns "EVEN" if the number is EVEN or returns "ODD" if the number is ODD.
Output
need an explanation for this answer? contact us directly to get an explanation for this answer