一、collections.Counter()
A counter is a container that stores elements as dictionary keys, and their counts are stored as dictionary values.
Sample Code
from collection import Countermylist [1, 1, 2, 3, 4, 5, 3, 2, 3, 4, 2, 1, 2, 3]print(Counter(mylis…