🎙 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 9 of 15

What does this print? (code)

What does this print?

d = {"a": 1, "b": 2}
print("b" in d, 2 in d)
  1. A.True False
  2. B.True True
  3. C.False True
  4. D.False False
Answer & explanation

Correct answer: True False

in checks keys, not values.

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 →