Source Code:
(back to article)
from collections import Counter my_list = [1, 2, 3, 1, 2, 3, 1, 2, 3] counter = Counter(my_list) count = counter[1] print(count) # Output: 3
Result:
Report an issue