Konversi daftar nilai menjadi kamus berdasarkan jumlah
counts = dict()
for i in items:
counts[i] = counts.get(i, 0) + 1
Protelr
counts = dict()
for i in items:
counts[i] = counts.get(i, 0) + 1