I am trying to create a recursion function using iterations , in a brief the function checks if the iteration is equal to zero , if it does the function stops , if it doesn’t the function starts and at the end it returns itself and it returns iterations -1 to determine the recursion steps , like the following ;

def Function( inputList , iterations):

NewList =

if iterations == 0 :

return “finished”

else :

process (inputList)

etc…

NewList.append(process result)

return def Function( NewList , iterations-1)

OUT = Function( input , iterations)

the problem is when ever i run the script , dynamo gives the result “finished” , means that the iteration is 0

any help plz lineloop2.py (2.0 KB)