I would like to give some feedback about ...
From: http://www.checkio.org/mission/most-wanted-letter/solve/
HTTP_USER_AGENT:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
This code does'n work properly on site, but it should, you can check it locally
import string
dict_alphabet = dict.fromkeys(string.ascii_lowercase, 0)
def checkio(text):
list_result = []
for i in text:
if i.lower() in dict_alphabet:
dict_alphabet[i.lower()] +=1
max_val = max(dict_alphabet.values())
for i in dict_alphabet:
if dict_alphabet[i] == max_val:
list_result.append(i)
list_result.sort()
return list_result[0]
print checkio("One")
It returns "e", but fails in checkio
Created at: 2015/11/18 21:47; Updated at: 2015/11/19 09:56