🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: The collections Module: all 10 questions

Quiz: The collections Module · Question 1 of 10

What does this print? (code)

What does this print?

from collections import Counter
print(Counter("banana").most_common(1))
  1. A.[('n', 2)]
  2. B.[('a', 3)]
  3. C.[('b', 1)]
  4. D.{'a': 3}
Answer & explanation

Correct answer: [('a', 3)]

"a" appears 3 times, more than any other letter.

Can you get the rest right without peeking?

Take the timed Quiz: The collections Module quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →