QuestionQ86Verified/ExceptionsCopy linkReport a problemAsk AstroTutorSave questionWhat behavior is expected from the following code? Aoutputs list assignment index out of rangeBit outputs NoneCit outputs 'tuple' object does not support item assignmentDthe code is erroneous and it will not executeShow AnswerAnswerExplanationTuples are immutable, so assigning to my_tuple[3] raises a TypeError stating that a tuple object does not support item assignment. That exception is caught by except Exception as exception, and print(x) outputs the error message.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion