def sum(a, b, c):
return a + b + c
a = [1, 2, 3]
# the * unpack a list
print sum(*a)
>> 6
def sum(a, b, c):
return a + b + c
a = {'a': 1, 'b': 2, 'c': 3}
# the ** unpack a dict
print sum(**a)
>> 6
def sum(a, b, c):
return a + b + c
a = [1, 2, 3]
# the * unpack a list
print sum(*a)
>> 6
def sum(a, b, c):
return a + b + c
a = {'a': 1, 'b': 2, 'c': 3}
# the ** unpack a dict
print sum(**a)
>> 6