Python Program to Check Number is Odd or Even Using Function

 Python Program to Check Number is Odd or Even Using Function


Function with argument but no return

def oddeven(a):  # function definition
    if a%2==0:
        print(f"{a} is EVEN")
    else:
        print(f"{a} is ODD")
n=int(input("Enter Number: "))  # user input
oddeven(n)  # function call

Output:
Enter Number: 2
2 is EVEN

टिप्पणी पोस्ट करा

0 टिप्पण्या