def sum(*args): tot = 0 for arg in args: tot += arg return tot print sum(1, 2, 3, 4, 5, 6) mylist = [1, 2, 3, 4] print sum(*mylist)