Mutable vs Immutable Objects in Python: Explained with Memory References
Introduction
If you're new to Python, you've probably seen code like this:
numbers1 = [1, 2, 3]
numbers2 = numbers1
numbers1[0] = 100
print(numbers1)
print(numbers2)
Output
[100, 2, 3]
[100, 2, 3]
imohit1o1.hashnode.dev3 min read