Let's say I have a tuple
t = (1, 2, 3)
and a function
def test(a, b, c):
print a + b + c
I could then call
test(t[0], t[1], t[2])
Is there a more elegant way to do this for a large tuple (or other data type, e.g. list)? Like so:
test(t.unpack_as_args())
What syntax can I use in place of t.unpack_as_args()
?