Why isn't my code running correctly?


#1




Does your scrabble_score function take exactly one argument (a string)? Your code threw a "'str' object does not support item assignment" error.


def scrabble_score(word):
    word = word.lower()
    l = len(word)
    total = 0
    for i in range(0, l):
        for word[i] in score:
            total = total + score[word[i]]
    return total


#2

why do you need a second for loop? the first one already gives you access to the letters of word which you can then add to total


#3

Thanks. I got it :grin::grin::grin:


#4