Advertisement
KaeruCT

Untitled

Apr 26th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. cont = 0
  2. lista = []
  3. while cont < 20:
  4.     # revise usted si el numero es valido
  5.     n1 = int(input("Ingrese un numero: "))
  6.     lista.append(n1);
  7.     cont += 1
  8.  
  9. nRepetido = 0
  10. nRepeticiones = 0
  11. for x in lista:
  12.     repeticiones = lista.count(x)
  13.     if repeticiones > nRepeticiones:
  14.         nRepeticiones = repeticiones
  15.         nRepetido = x
  16.    
  17. print("Numero que mas se repite: %s" % nRepetido)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement