Vidyalelo
Python · Q44

MCQs for Python Dictionaries: Exam

Programming · Python · question 44

Q44

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

A.
Counter({3: 12, 4: 1, 5: 1})
B.
Counter({3: 1, 4: 1, 5: 1})
Answer
C.
Counter({4: 2})
D.
Counter({5: 1})

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board