Changing local variable using recursion

I am using a recursive function implemented in a python class. Am I right that the local variable (passed through the methods attributes) isn’t changing through a recursive change? I have the following tree: example tree My current method is the following: def readSequence(self, linkTable, partTable, seq, element): #clearFlags returns an array of objects with… Read More Changing local variable using recursion

using same variable that is created in function into another function

I want to use ‘number’ variable that was created out of the function and use it in couple functions and also give it an initial value 0, but it gives "local variable ‘number’ referenced before assignment" error at the last line of code.How could I fix it?Thanks in advance. lst_img=[img0,img1,img2,img3,img4] number=0 def go_forward(): global number… Read More using same variable that is created in function into another function