What is the output of the following Python code snippet?
from collections import Counter
print(Counter('aaabbc'))
print(Counter('aaabbc'))
Correct answer
A. Counter({'a': 3, 'b': 2, 'c': 1})
5 views
A. Counter({'a': 3, 'b': 2, 'c': 1})
5 views
Counter counts hashable items and orders output by frequency.
Asked in: Python Interview Dictionaries
https://docs.python.org/3/tutorial/datastructures.html#dictionariesNot sure why the answer is A? Ask here and get an explanation.