lefthalf ' righthalf ' for in range( )each half line has characters lefthalf +random choice(garbage_chars righthalf +random choice(garbage_chars fill in the password from words if linenum in lineswithwords find random place in the half line to insert the word insertionindex random randint( insert the word lefthalf (lefthalf[:insertionindexwords[nextword lefthalf[insertionindex :] nextword + update the word to put in the half line if linenum in lineswithwords find random place in the half line to insert the word insertionindex random randint( insert the word righthalf (righthalf[:insertionindexwords[nextword righthalf[insertionindex :] nextword + update the word to put in the half line computermemory append(' xhex(memoryaddress)[ :zfill( lefthalf ' xhex(memoryaddress ( * ))[ :zfill( righthalf memoryaddress + jump fromsay xe to xe each string in the computermemory list is joined into one large string to return return '\njoin(computermemory def askforplayerguess(wordstries) """let the player enter password guess "" while true print('enter password({tries remaining)format(tries) guess input(''upper( if guess in words return guess print('that is not one of the possible passwords listed above ' print('try entering "{}or "{}format(words[ ]words[ ]) if this program was run (instead of imported)run the game if __name__ ='__main__' try main( except keyboardinterrupt sys exit(when ctrl- is pressedend the program project #