# Welcome to softhunt.net
def adder(*num):
sum = 0
for n in num:
sum = sum + n
print("Sum:",sum)
adder(5,8)
adder(6,7,8,9)
adder(11,12,13,14,15)
# function with variable-length arguments
def percentage(*args):
sum = 0
for i in args:
# get total
sum = sum + i
# calculate average
avg = sum / len(args)
print('Average =', avg)
percentage(56, 61, 73)