Scrabble_score


#1




Oops, try again. Remember to make your function work for upper- and lowercase letters!


Well, I actually use lower() function, don't I ? haha


Replace this line with your code. 
def scrabble_score(word):
    final_score = 0
    for letter in word:
        letter.lower()
        final_score += score[letter]
    return final_score

Plus, is there other errors ? Or all wrong, LOL
Thanks for help


#2

You do use the string's lower method, yes. But you ignore its result and instead look up the score for the original letter.


#3

Thanks, bro, now it works
You're my hero. I thought if I used letter.lower(), every letter should've changed to lowercase permanently.
Thanks hero, LOL


#4

Strings can't be changed, so that method would never do so. In contrast to list's append method, this one creates and returns a new value.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.