total += int(score[word[i]])
I am trying to have a variable, total, take the input, “word”, at index, i; for example, “hello” should give me “h” on the first run through, and then have my code look at the dictionary, score, at index, [word[i]] (in this case, “h”). This should give me a key, 4. I’m not sure if it’s being interpreted as a string or not, so I forced it into an integer to be sure.
Then, I have the code loop through the rest of the word, summing up the values of the keys.
Is my thinking off with this part of the code?