Guest User

is_valid_word

a guest
Apr 25th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. a = 0
  2. if word in word_list:
  3. for letter in word:
  4. if letter not in hand:
  5. return False
  6. if letter in hand and hand[letter]>0:
  7.  
  8. a = a + 1
  9. hand[letter] -= 1
  10. if a == len(word):
  11. return True
  12. else:
  13. return False
  14. return False
Advertisement
Add Comment
Please, Sign In to add comment