You can use a dictionary, you may just need to use a dictionary from the very beginning, not a list, but here is a simple setup.
mylist = ['General Store','Mall','Ice Cream Van','General Store']
def votes(mylist):
d = dict()
for value in mylist:
if value not in d:
d[value] = 1
else:
d[value] +=1
return d
def print_votes(dic):
for c in dic:
print c +' - voted', dic[c], 'times'
print_votes(votes(mylist))
It outputs:
Mall - voted 1 times
Ice Cream Van - voted 1 times
General Store - voted 2 times
source
share