Artyom Lazovikov Asked:2020-01-21 02:10:22 +0000 UTC2020-01-21 02:10:22 +0000 UTC 2020-01-21 02:10:22 +0000 UTC 建议一种方法来计算列表中每个元素的重复次数。Python 772 建议一种方法来计算列表中每个元素的重复次数。Python python 1 个回答 Voted Best Answer USERNAME GOES HERE 2020-01-21T02:37:40Z2020-01-21T02:37:40Z a = [1,2,3,2,1,5,6,5,5,5] import collections print len([item for item, count in collections.Counter(a).items() if count > 1])
1 个回答