QuestionQ220Verified/Data Collections – Tuples, Dictionaries, Lists, and StringsCopy linkReport a problemAsk AstroTutorSave questionWhat is the expected output from the following code? A{(2, 3): 2}B{(1, 2): 1}CThe code is erroneous.D1Show AnswerAnswerExplanationPython dictionaries can use tuples as keys. The subscript x[1, 2] denotes the tuple key (1, 2), which maps to the value 1; therefore, the code prints 1.Show comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion