Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python2
- datos=raw_input("introduce los numeros a clasificar...")
- elementos=[]
- for x in datos:
- if elementos.count(x) == 0:
- elementos.append(x)
- d={}
- for x in elementos:
- d[x]=datos.count(x)
- lista=d.items()
- lista.sort(key=lambda x: x[1])
- lista.reverse()
- print lista
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement