Intermediate Python
Q62 / 101

What does collections.Counter do?

Correct! Well done.

Incorrect.

The correct answer is B) A dict subclass for counting hashable objects

B

Correct Answer

A dict subclass for counting hashable objects

Explanation

Counter("banana") returns Counter({'a': 3, 'n': 2, 'b': 1}). It supports most_common() and arithmetic operations.

Progress
62/101