Länk - Count the number of occurrences of items in a python sequence

published Jun 13, 2012 03:25   by admin ( last modified Jun 13, 2012 03:25 )

Found this on stackoverflow:

dict((i,a.count(i)) for i in a)



Read more: How to calculate the occurrences of a list item in Python? - Stack Overflow