QuestionQ68Verified/Data Collections – Tuples, Dictionaries, Lists, and StringsCopy linkReport a problemAsk AstroTutorSave questionWhat is the anticipated output of the following code? A(1, 2)BThe code is erroneous.C{'a':1, 'b':2}D[1,2]Show AnswerAnswerExplanationThe expression data['a', 'b'] creates the tuple key ('a', 'b'). Because that key is not present in the dictionary, Python raises a KeyError.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion