Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def cores():
- lista= [[0,1,3,4],[2,1,1,4],[3,2,1,3],[4,2,1,3], [0,1,0,2]]
- aux = []
- for i in range(len(lista)):
- for j in lista[i]:
- aux.append(j)
- maior = aux.count(aux[0])
- num=0
- for i in aux:
- if aux.count(i)>maior:
- maior = aux.count(i)
- num = i
- percentagem = maior/len(aux)*100
- print ("O numero",num, "aparece",percentagem, "% das vezes")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement