Mahmoud A. Raouf Mahmoud A. Raouf - 1 month ago 5
Python Question

Call a function inside another function call

def func1(arg1,arg2,arg3,arg4)
...

def func2(arg5,arg6)
return a,b,c,d

func1(func2(arg5,arg6))


Can I call func1(func2(arg5,arg6)) like this??
as func2 will return 4 items that'll be passed to func1

Answer

You would have to unpack the arguments, but yes you can do that using the * operator.

func1(*func2(arg5,arg6))