QuestionQ149Verified/Data Collections – Tuples, Dictionaries, Lists, and StringsCopy linkReport a problemAsk AstroTutorSave questionHow can you remove every item from the d dictionary? Expected output: Code: Ad.del()Bd.remove()Cdel dDd.clear()Show AnswerAnswerExplanationPython’s dict.clear() method removes all key-value pairs from a dictionary in place, leaving the dictionary as {}.Show comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion