Traceback (most recent call last):
_ File "python", line 19, in _
_ File "python", line 16, in scrabble_score_
NameError: global name 'socre' is not defined

the "score"is of dic.
why should i have define the global name again?
the issue is seen for now ,i am not sure any other issue occur sequently.

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):
    for m in word :
        if m not in score:
    return score


Just looking at the error message you have, in this line:


you misspelled score (seems you swapped the c and o)


Thanks for watching!

this may draw a mistake from audience.
ths "acore "is just a variable which i named for storing the score.
because the word "score " is already taken for the dic.


Forgive a non native english speaker, but did you resolve the issue?

Naming your variable the right way is very important, i wouldn't have called the variable acore, i would have it total_score or points, or something else logical.


i am chinese.
i have to check the basis knowledge of the dic.
i will keep my eye on it until i solve it.


but did you correctly spell score on this line:


yes, i know acore is a variable, but socre isn't, it is misspelled, it should be:

acore += score[m:]


oh, i finally ran your code, there seem to be many more problems. This line:

acore += score[m:]

requires another update, it should be score[m], m contains your letter, which mean using brackets notation will get the right value.

You are trying to convert to lowercase here:


but lower is a function, so in other to call a function, should be function name + brackets:


now, m becomes lowercase, but it doesn't store this anywhere, you could just store this in m:

m = m.lower()

And finally this line:

return score

i would return the total score (your score variable doesn't contain the total score), now which variable contains the total score?


yes i can run it too.I have so weak basis of the fundamental knowledge.

thank u.