Skip to content

Instantly share code, notes, and snippets.

@talesa
Created April 17, 2019 11:12
Show Gist options
  • Save talesa/159bb9e485b32e5b5bc143200de9b679 to your computer and use it in GitHub Desktop.
Save talesa/159bb9e485b32e5b5bc143200de9b679 to your computer and use it in GitHub Desktop.
t = (1, 2, [30, 40])
t[2] += [50, 60]
print(t)
# Options:
# a) t becomes (1, 2, [30, 40, 50, 60]).
# b) TypeError is raised with the message 'tuple' object does not support item assignment.
# c) Neither.
# d) Both a and b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment