python newbie

BartlebyScrivener rpdooling at gmail.com
Fri Nov 2 12:06:53 EDT 2007


On Nov 2, 10:13 am, Jim Hendricks <j... at bizcomputinginc.com> wrote:

> Here's an example of what I am asking:

Try this example from Beazley (pg 82)

a = 42
def foo():
    a = 13
foo()
print a
42

By contrast:

a = 42
b = 13
def foo():
    global a, b
    a = 13
    b = 0
foo()
print a
13
print b
0




More information about the Python-list mailing list