List copies and references

a = [1, 2]; b = a; b.append(3) → a = [1, 2, 3]

You can also choose a level by clicking a star.

About the course

Description
The assignment b = a does not copy the list – both variables point to the same list; a[:] or a.copy() makes a copy
More information
Working with lists and strings in Python. Indexes start at zero.
Sample question
a = [1, 2]; b = a; b.append(3) → a = [1, 2, 3]
Author
Jiří Preisler
Version
1.0