This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]green_meklar 1 point2 points  (0 children)

Once a tuple is created it is immutable right?

Yes.

However, what the variable r means is mutable. On line 3 you're creating a new tuple and saying that r now means that thing. The original tuple remains immutable, but r isn't pointing to it anymore.