← Quiz: Python Dictionaries: all 15 questions
Quiz: Python Dictionaries · Question 10 of 15
What does this print? (code)
What does this print?
d = {"a": 1}
print(d.pop("a"), d)
- A.1 {}
- B.a {}
- C.1 {'a': 1}
- D.An error
Answer & explanation
Correct answer: 1 {}
pop removes the key and returns its value.
Can you get the rest right without peeking?
Take the timed Quiz: Python Dictionaries quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →