[Tutor] scoping oddity
Michael.Coll-Barth@VerizonWireless.com
Michael.Coll-Barth at VerizonWireless.com
Sat May 7 15:56:35 CEST 2005
Good morning,
I came across a rather odd issue with scoping. Can someone explain why
testa and testc works, but not testb. I am running under python 2.4.1 on
Windows NT.
thanks,
Michael
x = 5
def testa(astr):
print astr, x
testa(22)
def testb(astr):
x = x - 1
print astr, x
testb(22)
def testc(astr):
print astr, x-1
testc(22)
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
More information about the Tutor
mailing list