Skip to content

Instantly share code, notes, and snippets.

@kgashok
Last active June 3, 2019 17:13
Show Gist options
  • Save kgashok/d8b106584f784570c7b76c7130aba7d4 to your computer and use it in GitHub Desktop.
Save kgashok/d8b106584f784570c7b76c7130aba7d4 to your computer and use it in GitHub Desktop.
"Tuples are immutable, but their mutable constituents, if any, are mutable!"
tup1 = (1, 2, [3, 4, 5])
print(tup1)
print("Tuples are immutable, but their mutable constituents, if any, are mutable!")
tup1[2][2] = 'x'
print(tup1)
# (1, 2, [3, 4, 'x'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment