Light Mode
Dark Mode
Most wanted letter code question

Hello All! I am new to this so I was wondering if someone could help me figure out why this code doesn't work on the website but works fine on my desktop and in a visualization for python that I use.

def checkio(text):
    letters = {}
    text = text.replace(' ', '')
    for l in str(text.lower()):
        if l in letters:
            letters[l] += 1
        else:
            letters[l] = 1
    x = sorted(letters)
    mx = max(x, key=letters.get)
    print (mx)
    return (mx)
Created: Dec. 10, 2015, 4:38 p.m.
Updated: Dec. 13, 2015, 10:42 a.m.
0
4
User avatar
cadams00