QuestionQ177Verified/Data Collections – Tuples, Dictionaries, Lists, and StringsCopy linkReport a problemAsk AstroTutorSave questionWhat output is expected from the following code? AThe code raises an exception and outputs nothing.B4C5D6Show AnswerAnswerExplanationAssignment of a Python list creates another reference to the same list rather than a copy. The append operation therefore leaves both variables referring to a three-item list, so len(collection) + len(duplicate) evaluates to 3 + 3, or 6.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion