Question: Write a function called place _ ghosts that accepts 2 arguments. The first argument called board is a list of lists. The second argument called

Write a function called place_ghosts that accepts 2 arguments. The first argument called board is a list of lists. The second argument called ghosts is a list of string objects.The board contains a player (represented by the string '^) and a melon (represented by the string 'M') at random locations. All other locations in the board are empty and are filled in with 0. The function places each ghost in the ghosts list at random empty locations in the board. After placing all the ghosts, the function returns a list ofTime left 0:08:09each tuple is the location i.e. the (row, col) pair where a ghost has been placed.In addition to the placelghosts function the program also has a main function. The main function calls the place ghosts function with the required arguments. Assume themain function already exists and looks like thisdef main ():board = LLO, PI.00.01.1M.910ghosts = UG,'G','G']ghosts/tocations = place_ghest= board, ahost=print (Board:', board)print ('Ghosts Locations :', ghostsFFo0MtFonMmain ()When the program is executed, something similar to the following output is displayed:Board: [l'G','P'],['G'.01. UM.*G*31Ghosts Locations: [(0,0).(1,0).(2.1)]Complete the place_ghosts function by dragging and dropping the answers in the blanks to make it work as desired
 Write a function called place_ghosts that accepts 2 arguments. The first

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!