dict = { } for item in list: if not item in dict: dict[item] = 1 else: dict[item] += 1