from collections import Counter
import re
def checkio(text: str) -> str:
text1 = re.findall('[^\W]', text.lower())
a = (''.join(text1))
text2 = re.findall('[a-z]', a)
a1 = (''.join(text2))
return(Counter(a1).most_common(1)[0][0])
print(checkio("Hello World!")) # == "l", "Hello test"
print(checkio("How do you do?")) # == "o", "O is most wanted"
print(checkio("One")) # == "e", "All letter only once."
print(checkio("Oops!")) # == "o", "Don't forget about lower case."
print(checkio("AAaooo!!!!")) # == "a", "Only letters."
print(checkio("abe")) # == "a", "The First."
print(checkio("a" * 9000 + "b" * 1000)) # == "a", "Long."
Как решить проблему если при "One" должно получиться "e", а при "abe" должна получиться "a"?
Задавали тот же вопрос вот здесь: https://ru.stackoverflow.com/questions/1036053/Самая-частая-буква-в-тексте