Lists
1 / 21
EasyOutput prediction

Slice creates a shallow copy

What does this code print?

a = [1, 2, 3]
b = a[:]
b.append(4)
print(a)

← → arrow keys to navigate

Sign in to save your progress.