if sonardevices extrassonar ' elseextrassonar ' if len(thechests extraschest ' elseextraschest ' print('you have % sonar device% left % treasure chest% remaining (sonardevicesextrassonarlen(thechests)extraschest)line ' while loop executes as long as the player has sonar devices remaining line prints message telling the user how many sonar devices and treasure chests are left but there' small problem if there are two or more sonar devices leftyou want to print ' sonar devicesbut if there' only one sonar device leftyou want to print ' sonar deviceleft you only want the plural form of "devicesif there are multiple sonar devices the same goes for ' treasure chestsand ' treasure chestlines through have code after the if and else statementscolon this is perfectly valid python instead of having block of code after the statementyou can use the rest of the same line to make your code more concise the two variables named extrassonar and extraschest are set to ' (spaceif there are multiple sonar devices or treasures chests otherwisethey are blank strings these variables are used on line getting the player' move xy enterplayermove( previousmoves append([xy]we must track all moves so that sonar devices can be updated moveresult makemove(theboardthechestsxy if moveresult =false continue line uses multiple assignment since enterplayermove(returns two-item list the first item in the returned list is assigned to the variable the second is assigned to the variable they are then appended to the end of the previousmoves list this means previousmoves is list of xy coordinates of each move the player makes in this game this list is used later in the program on line the xytheboardand thechests variables are all passed to the makemove(function this function will make the necessary modifications to the game board to place sonar device on the board