find at least seven words that have at least one matching letter (but give up at tries if not enough can be found for in range( ) if len(words= break found or more wordsso break out of the loop randomword getonewordexcept(words if nummatchingletters(secretpasswordrandomword! words append(randomword add any random words needed to get words total while len(words randomword getonewordexcept(words words append(randomword assert len(words= return words def getonewordexcept(blocklist=none) """returns random word from words that isn' in blocklist "" if blocklist =none blocklist [ while true randomword random choice(words if randomword not in blocklist return randomword def nummatchingletters(word word ) """returns the number of matching letters in these two words "" matches for in range(len(word )) if word [ =word [ ] matches + return matches def getcomputermemorystring(words) """return string representing the "computer memory"" pick one line per word to contain word there are linesbut they are split into two halves lineswithwords random sample(range( )len(words) the starting memory address (this is also cosmetic memoryaddress random randint( create the "computer memorystring computermemory [will contain stringsone for each line nextword the index in words of the word to put into line for linenum in range( )the "computer memoryhas lines create half line of garbage charactershacking minigame