← Quiz: Python Dictionaries: all 15 questions
Quiz: Python Dictionaries · Question 7 of 15
What does this print? (code)
What does this print?
d = {"x": 1, "y": 2}
print(list(d.items())[1])
- A.('x', 1)
- B.('y', 2)
- C.2
- D.y
Answer & explanation
Correct answer: ('y', 2)
Dictionaries keep insertion order.
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 →