Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Most Wanted Letter by bajibaji
from collections import Counter
import string
def checkio(text: str) -> str:
stext=sorted(text.lower())
letters = (c for c in stext if c in string.ascii_lowercase)
ct=Counter(letters)
result=ct.most_common()[0][0]
return(result)
# These "asserts" are used for self-checking
assert checkio("Hello World!") == "l"
assert checkio("How do you do?") == "o"
assert checkio("One") == "e"
assert checkio("Oops!") == "o"
assert checkio("AAaooo!!!!") == "a"
assert checkio("abe") == "a"
print("The mission is done! Click 'Check Solution' to earn rewards!")
Sept. 22, 2024
Comments: