Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def cores():
  2. lista= [[0,1,3,4],[2,1,1,4],[3,2,1,3],[4,2,1,3], [0,1,0,2]]
  3. aux = []
  4. for i in range(len(lista)):
  5. for j in lista[i]:
  6. aux.append(j)
  7. maior = aux.count(aux[0])
  8. num=0
  9. for i in aux:
  10. if aux.count(i)>maior:
  11. maior = aux.count(i)
  12. num = i
  13. percentagem = maior/len(aux)*100
  14. print ("O numero",num, "aparece",percentagem, "% das vezes")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement