Python code:
#defining isEven function
def isEven(n):
#returning True if number is even else
False
return n%2==0
#accepting the number
n=int(input("Enter a number: "))
#calling isEven function and checking if it is Even or not
if(isEven(n)):
#printing Even number
print("Even number")
else:
#printing Odd number
print("Odd number")
Screenshot:
Input and Output:
Get Answers For Free
Most questions answered within 1 hours.