anonymous
  • anonymous
Hi! everyone! I'm working on #3 of problem set 5 which is a word game. I keep getting this error for some reason. I don't understand what this tells me. if is_valid_word(word, hand, word_list): File "/Users/piljoomoon/Documents/ps5.py", line 181, in is_valid_word if hand[letters] == 0 or hand[letters] < 0: KeyError: 'h' ##hand is a dictionary (string-->int) Is there anyone who completed this homework and can help me?
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
Where is your source code?
anonymous
  • anonymous
HI Fonzy, This is my code: http://dpaste.com/842327/
anonymous
  • anonymous
http://docs.python.org/2.7/library/exceptions.html#exceptions.KeyError

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

rsmith6559
  • rsmith6559
Just for troubleshooting, print letters and hand[ letters ] just before the if statement in line 181. I'll bet you'll be surprised.

Looking for something else?

Not the answer you are looking for? Search for more explanations.