Advertisement
Guest User

Untitled

a guest
Oct 29th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #!/usr/bin/python2
  2.  
  3. datos=raw_input("introduce los numeros a clasificar...")
  4. elementos=[]
  5. for x in datos:
  6. if elementos.count(x) == 0:
  7. elementos.append(x)
  8.  
  9. d={}
  10. for x in elementos:
  11. d[x]=datos.count(x)
  12. lista=d.items()
  13. lista.sort(key=lambda x: x[1])
  14. lista.reverse()
  15. print lista
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement