is it possible to do something like that?
def multireturn():
return 1, 2, 3
def add(a, b, c):
return a+b+c
add(multireturn())
When I tried it, it errored as it sees only one argument. Thanks!
You need to unpack the tuple
returned from the first function to make it behave as sequential positional arguments to the second. The *
unpacking operator allows this:
add(*multireturn())
you need to add the unpacking operator *
to unpack the tuple
returned from the first function . try :
add(*multireturn())