Examveda

What will be the output of the following Python code snippet?
>>>import collections
>>> a=collections.Counter([1,1,2,3,3,4,4,4])
>>> a

A. {1,2,3,4}

B. Counter({4, 1, 3, 2})

C. Counter({4: 3, 1: 2, 3: 2, 2: 1})

D. {4: 3, 1: 2, 3: 2, 2: 1}

Answer: Option C


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python