python統計列表中個元素出現各次數

from collections import Counterhtml Counter(a)code a = [9, 9, 3, 1, 1, 2]htm result = Counter(a)io print(result)class 或者import for x in a: if a.count(x)>1: print(x) # im
相關文章
相關標籤/搜索