why the following 2 prg give different results? a.py is ok, but b.py
is 'undefiend a'
I am using Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC
v.1310 32 bit (Intel)] on win32
#a.py
def run():
        if 1==2:                # note, it always False
        global a
        a=1

run()
a

#b.py
def run():
        a=1

run()
a
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to