Hi, 
I try to learn python.
I don't understand this:

(running in idle)

>>> dept=0
>>> def mud():
        print dept

        
>>> mud()
0
>>> def mud():
        dept+=1
        print dept

        
>>> mud()
Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    mud()
  File "<pyshell#6>", line 2, in mud
    dept+=1
UnboundLocalError: local variable 'dept' referenced before assignment
>>> 

Regards MB

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to