Live Engine
Select Topic
easyLinear Data Structures
A developer assigns a list to two variables. What does this print, and what is the key insight about list assignment in Python?
Code
a = [1, 2, 3]
b = a
c = a.copy()
a.append(4)
print(b)
print(c)
print(a is b)
print(a is c)