Light Mode
Dark Mode
code doesn't work!!!!

code works on all the asserts solutions but doesn't work on "Lorem ipsum dolor sit amet" for some reason it adds "o's" that aren't there (if that makes any sense). i have been working on this for a couple of days and still haven't figured it out. need help....

def checkio(text):
    lowertext = text.lower()
    newtext = {}
    for i in lowertext:
        if i == " " or i == "!":
            continue 
        elif not i in newtext:
            newtext[i] = 1
        else:
            newtext[i] += 1

    return max(newtext.iterkeys(), key=(lambda key: newtext[key]))[0]
Created: Nov. 24, 2014, 9:46 p.m.
Updated: Nov. 28, 2014, 10:34 p.m.
0
6
User avatar
misterhaywood