# File: scope5.py # # This is a silly hack. # We made n global, but now it is # always the variable n that gets # changed, even when we call inc(b). # def inc(x): global n n = x + 1 return n n = 3 print(inc(n)) print("n = ", n) b = 15 print(inc(b)) print("b =", b) print("n = ", n) ''' Output from the program: 4 n = 4 16 b = 15 n = 16 '''