🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Comprehensions and Lambda: all 15 questions

Quiz: Comprehensions and Lambda · Question 11 of 15

What does this print? (code)

What does this print?

names = ["Asha", "Ravi", "Neha"]
marks = [91, 78, 85]
print(dict(zip(names, marks))["Ravi"])
  1. A.Ravi
  2. B.78
  3. C.('Ravi', 78)
  4. D.KeyError
Answer & explanation

Correct answer: 78

zip pairs the items by position, and dict turns the pairs into keys and values.

Can you get the rest right without peeking?

Take the timed Quiz: Comprehensions and Lambda quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →