import string
letters = string.ascii_letters[:28]
letters2 = []
def checkio(text: str) -> str:
text = text.lower()
for i in text:
if i in letters:
letters2.append(i)
max_letter = letters2[0]
for i in range(1, len(letters2)):
if letters2.count(letters2[i]) == letters2.count(max_letter):
if letters2[i] < max_letter:
max_letter = letters2[i]
elif letters2.count(letters2[i]) > letters2.count(max_letter):
max_letter = letters2[i]
return max_letter
It works in Pycharm, but not here
Created at: 2019/09/11 13:42; Updated at: 2020/06/30 19:58
The question is resolved.