检查列表中的重复数字和个数(Python)
方法一:>>> mylist = [1,2,2,2,2,3,3,3,4,4,4,4]>>> myset = set(mylist)>>> for item in myset:print("the %d has found %d" %(item,mylist.count(item)))the 1 has...
复制链接