from collections import Counter
a = [1, 2, 3, 1, 1, 2]
result = Counter(a)
print result

输出:

  {1: 3, 2: 2, 3: 1}

相关文章:

  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2021-06-24
  • 2021-10-14
  • 2021-10-17
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2022-01-26
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
相关资源
相似解决方案