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?

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.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

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)
See more answers at brainly.com
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.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

Where is your source code?
HI Fonzy, This is my code: http://dpaste.com/842327/
http://docs.python.org/2.7/library/exceptions.html#exceptions.KeyError

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

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

Not the answer you are looking for?

Search for more explanations.

Ask your own question