ch04
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# key.points.mutable.py
|
||||
x = [1, 2, 3]
|
||||
def func(x):
|
||||
x[1] = 42 # this affects the `x` argument!
|
||||
|
||||
func(x)
|
||||
print(x) # prints: [1, 42, 3]
|
||||
Reference in New Issue
Block a user