Parameter passing of functions
x = 3
def inc(n):
n += 1
return n
print(x) # 3
print(inc(x)) # 4
print(x) # 3
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
x = 3
def inc(n):
n += 1
return n
print(x) # 3
print(inc(x)) # 4
print(x) # 3