1 2 3 4 5 6
def something(): if 0: x = 42 print x something()
Traceback (most recent call last): Line 6, in <module> something() Line 4, in something print x UnboundLocalError: local variable 'x' referenced before assignment