Tuesday, June 23, 2020

Python Function with example

def add(a,b):
    print(a+b)
def sub(a,b):
    print(a-b)
def factorial(a):
    f=1
    for i in range(1,a):
        f=f*i
        
    print(f)
x=add(5,4)
y=sub(9,8)
z=factorial(5)
print(x,y,z)

No comments:

Post a Comment