Skip to content

Instantly share code, notes, and snippets.

@kgashok kgashok/mutableTuple.py
Last active Jun 3, 2019

Embed
What would you like to do?
"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
You can’t perform that action at this time.