def add():
x = 15
def change():
global x
x = 20
print("Before making change:", x) #15
print("Making change ---")
change()
print("After making change:", x) #15 hmm why?
add()
print("Value of x:", x) #20
My question is why the value of x after making change still 15 since i think the global x
in change() would alternate the value of x to 20. An insight into the mix nature of call by reference + call by value of Python would be highly appreciated.