Globals and locals part 2 code
a = 1
def f():
a = a + 1
# or even shorter!
a += 1
f()
# >>> UnboundLocalError: local variable 'a' referenced before assignment
a = 1
def f():
a = a + 1
# or even shorter!
a += 1
f()
# >>> UnboundLocalError: local variable 'a' referenced before assignment