QuestionQ142Verified/Data Collections – Tuples, Dictionaries, Lists, and StringsCopy linkReport a problemAsk AstroTutorSave questionConsider this code. What does the second assignment do?AIt shortens the list.BIt reverses the list.CIt doesn’t change the list.DIt extends the list.Show AnswerAnswerExplanationTuple assignment swaps the values at indices 0 and 2. With a three-item list whose middle element remains unchanged, swapping the first and last elements reverses the list.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion