[ create a new paste ] login | about

Link: http://codepad.org/qda1gS1J    [ raw code | output | fork ]

Python, pasted on Sep 26:
1
2
3
4
5
6
def something():
  if 0:
    x = 42
  print x

something()


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


Create a new paste based on this one


Comments: