I have 2 functions fun_1
and fun_2
fun_1
→ loops over fun_2
and stores the output of it in a variable named X
.
I want the return value of fun_1
to be the value of each iteration of the loop, so the return value I need is a tuple of 5 values, each value for X
in one of the iteration instead of the value of only the last iteration.
Note:fun_1
and fun_2
are just examples for functions just to demonstrate the idea and understand it so that I can apply it to complex function.
def fun_1():
N = 0
while N <= 5:
X = fun_2()
N = N+1
return(X)