Konwertuj listę wartości na słownik na podstawie liczby

counts = dict()
for i in items:
  counts[i] = counts.get(i, 0) + 1
Protelr