[ create a new paste ] login | about

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

Python, pasted on May 24:
1
2
3
4
5
6
7
8
a=10

def fuc():
    print a
    a=5  
a=20
fuc()
print a


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


Create a new paste based on this one


Comments: