if len(thechests= print('you have found all the sunken treasure chestscongratulations and good game!' break sonardevices - if sonardevices = print('we\'ve run out of sonar devicesnow we have to turn the ship around and head' print('for home with treasure chests still out theregame over ' print(the remaining chests were here:' for xy in thechests print(% % (xy) if not playagain() sys exit(designing the program before trying to understand the source codeplay the game few times first to understand what is going on the sonar game uses lists of lists and other such complicated variablescalled data structures data structures are variables that store arrangements of values to represent something for examplein the tic tac toe tic tac toe board data structure was list of strings the string represented an xoor empty space and the index of the string in the list represented the space on the board the sonar game will have similar data structures for the locations of treasure chests and sonar devices how the code works sonar import random import sys lines and import modules random and sys the sys module contains the exit(functionwhich causes the program to terminate immediately this function is used later in the program drawing the game board def drawboard(board)post questions to