Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

LoveMathFermat

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?

  • one year ago
  • one year ago

  • This Question is Closed
  1. Fonzy
    Best Response
    You've already chosen the best response.
    Medals 0

    Where is your source code?

    • one year ago
  2. LoveMathFermat
    Best Response
    You've already chosen the best response.
    Medals 0

    HI Fonzy, This is my code: http://dpaste.com/842327/

    • one year ago
  3. bwCA
    Best Response
    You've already chosen the best response.
    Medals 0

    http://docs.python.org/2.7/library/exceptions.html#exceptions.KeyError

    • one year ago
  4. rsmith6559
    Best Response
    You've already chosen the best response.
    Medals 0

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

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.