variable scope question?

2008-05-13 Thread globalrev
http://mail.python.org/pipermail/python-list/2003-October/233435.html why isnt it printing a in the second(second here, last one in OP) example before complaining? def run(): a = 1 def run2(b): a = b print a run2(2) print a run() def run(): a = 1 def run2(b): print a

Re: variable scope question?

2008-05-13 Thread Gary Herron
globalrev wrote: http://mail.python.org/pipermail/python-list/2003-October/233435.html why isnt it printing a in the second(second here, last one in OP) example before complaining? def run(): a = 1 def run2(b): a = b print a run2(2) print a run() def run(): a = 1 def