The code is correct, but I wanted to figure out a way to use lambda to shorten it, but I'm still trying to get the hang of using lambda. How could I implement lambda to take a char in word and sum the values from the corresponding dictionary key?
Some where in my code I have invalid syntax, but I can't really figure out where. The first set of code is the original, the second is the attempt at using lambda.
def scrabble_score(word): word_lc = word.lower() new_score = 0 for char in word_lc: new_score += score[char] return new_score def scrabble_score(word): new_score = 0 new_score = sum(map(lambda char: for char in word.lower() in score[char])) return new_score