python统计元素重复次数
代码语言:javascript
复制# !/usr/bin/python3.4
# -*- coding: utf-8 -*-
from collections import Counter
arr = ['BAISC', 'Python', 'BASICA', 'GVBASIC', 'GWBASIC', 'Python', 'ETBASIC', 'QBASIC', 'Quick', 'Basic', 'Turbo', 'Basic']
counts = list(Counter(arr).items())
print(counts)