Scrabble score


def scrabble_score(word):
total = 0
for i in word.lower():
total += score.get(i)
return total

This is how I solved the scrabble score, but I was wondering if there was a better/ more efficient way.
I really don't like having to define total and set it to 0, is there some alternate method that's better?


Hello, I did it using the same way. I suppose this is the shortest way :smile:


i did:

def scrabble_score(word):
    word_list = list(word)

    total_score = 0

    for char in word_list:
        total_score += score[char.lower()]

    return total_score