Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numeri = [ 1, 1, 3, 4, 3, 1, 9, 2, 2 , 4 ]
- occorrenze = {}
- for da_contare in numeri:
- occorrenze_correnti = 0
- for num in numeri:
- if(num == da_contare):
- occorrenze_correnti += 1
- print(da_contare, '=>', occorrenze_correnti)
- occorrenze[da_contare] = occorrenze_correnti
- lista_nd = []
- for chiave in occorrenze:
- lista_nd.append(chiave)
- print(lista_nd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement