This is a problem asked before but I can't really understand the other explain of this kind of problem so I'm here to re-write it in more details. While studying I have encountered this kind of code that I am not at all familiar .. I can not understand how to interpret this g() function in f() function ! Why the piece of code inside g() where x = 10 and y = z*w does not run ? It's only print me the value of y I gave, calling f() with 5 !
x = 99
def f(y):
w = x + y
def g():
x = 10
y = z * w
print y
f(5)
See Question&Answers more detail:os