test1 = 0
def testFunc():
test1 += 1
testFunc()
I am receiving the following error:
UnboundLocalError: local variable 'test1' referenced before assignment.
Error says that 'test1' is local variable but i thought that this variable is global
So is it global or local and how to solve this error without passing global test1 as argument to testFunc?