- Back to Home »
- python-passing variable length of arguments
Posted by : ANIL KUMAR MULA
Friday, 2 January 2015

#variable length arguments in function
def add(*x):
sum1 = 0
for i in x:
sum1 += i
return sum1
print(sum1) #sum1 is out of its scope
print(add(2,3,4))
print(add(2,3,4,5,6,7))