Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

Finished pb set 5. Would like some suggestions/ critique. http://codepad.org/yYftkkcz Thanks in advance!

OpenStudy (anonymous):

at line 67&167 - the lower() method is available to all string objects --> you can just use - word.lower() line 69 - word_low[i] is already a string you don't have to turn it into one line 126, update_hand: the instructions say to assume that hand contains all the letters in word they also say that the function should not mutate the hand here is an alternate implementation - http://dpaste.com/670535/ line 168/169: if word is not in word list you could immediately return False http://dpaste.com/670542/ if an expression evaluates to a boolean you can just use it - you shouldn't compare it to True or False. For example lines 246, 247 should just be: if is_valid_word(word, hand, word_list):

OpenStudy (anonymous):

Thanks for the suggestions! I have a bad tendency to keep to my MATLAB script style...

OpenStudy (anonymous):

i didn't test it but it all looked like it would work ... i didn't look at play hand or play game very hard . http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html .

OpenStudy (anonymous):

Thanks for that link bwCA!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!