2023년 1월 3일 오후 2:31 (GMT+9) → 시간: 40분
파이썬
from collections import Counter
리스트에서 해당 값이 몇 번 나오는지를 count해서 딕셔너리 형태로 반환해준다.
Counter(["hi", "hey", "hi", "hi", "hello", "hey"]) Counter({'hi': 3, 'hey': 2, 'hello': 1})