Scrabble- code not working


#1

I don't understand why my code is not working:
the indentations are all correct, they are just not showing up here. Please help?

def scrabble_score(word):
    word=raw_input("Please enter a word")
    word=word.lower()
    l=len(word)
    total=0
    for i in range(0,l+1,-1):
         for letter in word:
            for letter in score:
                total=total+score[letter]
    return total

#2

Technically that loop is not needed.

    for letter in word:
        total += score[letter]

Here is a pattern to study:

return sum([score[i.lower()] for i in word])

Not to make a point, but to reverse engineer and compare to your code.


#3

when I remove the
for letter in word
loop, it still won't give me the results! Is there something else wrong in the code?


#4

It should give results since the code is fine. Are you wondering why it works? Are you getting any error messages?