Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. def higher(text):
  2. text = text.replace(" ", "")
  3. count = 0
  4. for char in text:
  5. current_count = text.count(char)
  6. if current_count > count:
  7. count = current_count
  8. last = char
  9. return text.replace(last, "")
  10.  
  11. print(higher("uk aaaa aaaa eeee iiii eeee iiii ku"))
  12. print(higher("otro texto"))
  13.  
  14. // varias veces el mismo texto
  15. print(higher(higher("uk aaaa aaaa eeee iiii eeee iiii ku")))
  16. print(higher(higher(higher("uk aaaa aaaa eeee iiii eeee iiii ku"))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement