Here are several functions that deal with global variables:
def Glop (P):
global X
P = P + 1
X = P
return
def Blort (Q):
global X
Glop (X+Q)
return
def Snort (R):
global X
Blort (X-R)
return
Each of the following calls are done in order, and each depends
on what has come before. What is the value of varaible X after
each function is called? It is expected that you trace these problems
manually, without help from Python, as you may see problems like this on
the final exam.
|