Header Ads

Responsive Ads Here

*args

*args



# def add(a,b):
#     return a+b

# print(add(2,3,4,5))


def add(*args): #----> Parametres # * makes a tuple of arguments

    x = 0
    for i in args:
        x += i
    return x
   

l = (2,3,4,5,6)
print(add(*l)) # ---> Arguments

Powered by Blogger.