On Fri, Aug 20, 2010 at 11:09 AM, M B <zna...@telia.com> wrote: > Hi, > I try to learn python. > I don't understand this: <snip> >>>> dept=0 <snip> >>>> 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
http://www.mail-archive.com/python-list@python.org/msg75263.html Cheers, Chris -- Google is your friend http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list