def average(*args):
sum= 0.0
if len(args)==0:
return 0.0
for x in args:
sum=sum+x
return sum/len(args)
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
def fn(*args):
print args
>>> fn()
()
>>> fn('a')
('a',)
>>> fn('a', 'b')
('a', 'b')
>>> fn('a', 'b', 'c')
('a', 'b', 'c')