Shown below is the syntax used to give a score for a user based on the letters from a user input word,
letter_with_score = {'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8,'i':9,'j':10,
'k':11,'l':12,'m':13,'n':14,'o':15,'p':16,'q':17,'r':18,'s':19,'t':20,
'u':21,'v':22,'w':23,'x':24,'y':25,'z':26, ' ':0}
while True:
user = input("Enter a word: ").lower()
print()
user_word_split = []
score = []
for i in user:
user_word_split.append(i)
for k, v in letter_with_score.items():
if k in user_word_split:
score.append(v)
print()
print(sum(score))
print()
However, for an example if a user inputs a word such as "Hello", the user will get a score of 40. Where the actual score should be 52.
How can this be resolved to get the actual score.