Within a function I have a cumulative variable, and I call this function over and over, the problem that it loses values every time it enters. Summarizing what I want to do is:
def teste(a):
a=a+1
c=7
print a
return c
def main():
a=1
for b in range(0,5):
c=teste(a)
main()
output is:
I would like to keep the value of a, and the output in this case be incremented.