🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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])
  1. A.('x', 1)
  2. B.('y', 2)
  3. C.2
  4. 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 →