examples/functions/call_by_value.py
x = 3 def inc(n): n += 1 return n print(x) # 3 print(inc(x)) # 4 print(x) # 3
Parameter passing of functions
examples/functions/call_by_value.py
x = 3 def inc(n): n += 1 return n print(x) # 3 print(inc(x)) # 4 print(x) # 3