Three Ways To Shallow Copy
original = [1, 2, 3]
a = list(original)
b = original.copy()
c = original[:]
c.append(4)
print(a is original, b is original, c is original)
print(original, c)
What does this print?
Sign in to answer questions and track your progress
Sign In