#9 scrabble


#1



Please help me I do not understand what I am doing wrong


The code passed, but I got this error in the console

None


score = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2, 
         "f": 4, "i": 1, "h": 4, "k": 5, "j": 8, "m": 3, 
         "l": 1, "o": 1, "n": 1, "q": 10, "p": 3, "s": 1, 
         "r": 1, "u": 1, "t": 1, "w": 4, "v": 4, "y": 4, 
         "x": 8, "z": 10}

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


#2

<function scrabble_score
at 0x7fed1b066938>
None

this is the error code


#3

it is not an error, but since you call the function without any arguments, it will display the function object and the memory address. Call the function with parentheses + arguments like you learned


#4

@stetim94
Well I fixed my code to this:

def scrabble_score(word):
    word = word.lower()
    total = 0
    for i in word:
        total+=score[i]
    return total
print scrabble_score(words)

and it gives me the following error message

Traceback (most recent call last):
  File "python", line 12, in <module>
NameError: name 'words' is not defined

#5

this line:

print scrabble_score(words)

the word you want to get the scabble score of should be a string


#6

Oh yey thanks it worked


#7