QuestionQ191

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

Assuming the tuple has been created correctly, its immutability means that the following instruction:

Question Image

Explanation

Tuple elements cannot be reassigned after the tuple is created. Assigning a value to my_tuple[1] is therefore illegal and raises a TypeError.

Community Discussion

No comments yet. Be the first to start the discussion!