Question: Make two helper functions called empty() and find(). The empty() function will take in a 2D list and will return True if all values in

Make two helper functions called empty() and find(). The empty() function will take in a 2D list and will return True if all values in the 2D list are 0 and False otherwise. The find() function will take in a 2D list and a value to search for. If the value is found within the 2D list, return a list of length 2 containing the x and y indices of the position of said value. Otherwise, return [-1, -1]Make two helper functions called empty() and find(). The empty() function will

1. Make two helper functions called empty) and find(). The empty() function will take in a 2D list and will return True if all values in the 2D list are 0 and False otherwise. The find() function will take in a 2D list and a value to search for. If the value is found within the 2D list, return a list of length 2 containing the x and y Indices of the position of said value. Othwise, return (-1, -1] [25 marks] Sample input: grid - [C23, 34, 67). [44, 5, 31. t7, 8, 9)) Sample output: empty (grid) -> False find(grid, 67)-> (0, 2) Sample input: grid - to, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0] Sample output: empty (grid) -> True find(grid, 69) -> (-1,-1]

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!