Commit 605248b8 authored by HARSH  DEPAL's avatar HARSH DEPAL

last commit

parent 1b1ea0bb
...@@ -29,4 +29,4 @@ Extra Credit: ...@@ -29,4 +29,4 @@ Extra Credit:
E.1) A tuple is a sequence of immutable Python objects. It can hold mutable objects such as lists. Assignments are not allowed in tuples. Yes we can append to a tuple but the id of the tupple changes. We are not updating the tuple but creating a new tupple from an old tuple. E.1) A tuple is a sequence of immutable Python objects. It can hold mutable objects such as lists. Assignments are not allowed in tuples. Yes we can append to a tuple but the id of the tupple changes. We are not updating the tuple but creating a new tupple from an old tuple.
E.2) Yes we can append elements to a list in a tuple. No this does not contradict the previous part. That's because tuples don't contain lists, strings or numbers. They contain references to other objects. The inablity to change the sequence of references a tuple contains doesn't mean that you can't mutate the object associated with those references. E.2) Yes we can append elements to a list in a tuple. No this does not contradict the previous part. That's because tuples don't contain lists, strings or numbers. They contain references to other objects. The inablity to change the sequence of references a tuple contains doesn't mean that you can't mutate the object associated with those references. Tuples are designed to contain mutable objects, tuple cannot identify if it contains references to mutable or immutable objects.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment