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

Hi all, I'm working on PS5_Ghost at the moment. I'm up to testing whether the word fragment is part of a valid word (ie "PEAF" is valid because it makes "PEAFOWL"). How did other people deal with this problem?

OpenStudy (anonymous):

I'm working on the same. I just put "if string_word in test_word:" I thought I would have to put something like index = len(string_word) if string_word in test_word[:index]: but it appears to be uneccessary. Mind I haven't finished this yet either.

OpenStudy (anonymous):

Hmmm... I just found that the above comment finds es in 'finest'. perhaps the second way is better.

OpenStudy (anonymous):

here is how i did it def ghostCheck(word,wordlist): for i in range (0,len(wordlist)): if word in (wordlist[i])[0:len(word)]: return True return False

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!