LISTL = [] VAR1 = 0 def foo(): ... VAR1 += 1 ... return VAR1 ...
If you assign to a variable within a function, that variable is assumed to be local unless you declare it global.
global