byteplayer78569, you are using 2,
for loops. both of them are using
s as the index so that is never going to end well .
Not sure of your logic even with that fixed. As far I can make out with my limited knowledge:
- With your first
for loop you are going through every letter in the
if is looking to see if the current letter is in the word.
- Not really sure what the 2nd
for is for but it looks like it aims to set up a count going from zero to 1 more than the end of the word. You are then using that number as an index to get values from the
score dictionary but the index of that is letters not numbers so it will not be able to find a corresponding value for that index entry.
What you should be doing is going through each letter of the word.
You should be using each letter as an index to
score adding the corresponding value of that letter to
final (for example: if the letter is q it should add 10 to
You just need 1
for loop and no