Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
x = [1, 2, 3]
print(x)
y = [1, 2, 3]
print(y)
x.append(4)
y.extend([4])
x.append([5, 6])
y.extend([5, 6])
print(x) # [1, 2, 3, 4, [5, 6]]
print(y) # [1, 2, 3, 4, 5, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment