QuestionQ199Verified/Data Collections – Tuples, Dictionaries, Lists, and StringsCopy linkReport a problemAsk AstroTutorSave questionWhat is the expected output from the following code? A1B4C3D2Show AnswerAnswerExplanationThe slice data[-2:-1] produces the one-item tuple (3,) because the ending index is excluded. Accessing index -1 of that tuple returns its final—and only—element, 3.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion