Question: 8 . Implement crossout Read the specification of the function crossout in the module funcs. This function is very similar to the one of the

8. Implement crossout
Read the specification of the function crossout in the module funcs. This function is very similar to the one of the same name from Exercise 1. The only difference is that this function modifies the original list and does not return anything. Look at the test cases in tests.py if you are unsure about how it works.
Remember that you should never modify the loop-sequence in a for-loop. So your implementation should either loop over something else (positions) or use a while-loop. Also: you will need to remove rows and columns by their index numbers for this function. What list methods can be used for this? Refer to the list methods documentation page, linked from the Calling List Methods video in Module Three to review your options.
When you have implemented the function, test your answer with the test script before moving on to the next function.
def crossout(table,row,col):
"""
Modifies the table to remove the given row and column.
Examples:
If a =[[1,3,5],[6,2,7],[5,8,4]], crossout(a,1,2) changes a to [[1,3],[5,8]]
If a =[[1,3,5],[6,2,7],[5,8,4]], crossout(a,0,0) changes a to [[2,7],[8,4]]
If a =[[1,3],[6,2]], crossout(a,0,0) changes a to [[2]]
If a =[[6]], crossout(a,0,0) changes a to []
Parameter table: the nested list to modify
Precondition: table is a table of numbers. In other words,
(1) table is a nested 2D list in row-major order,
(2) each row contains only numbers, and
(3) each row is the same length.
Parameter row: the row to remove
Precondition: row is an index (int) for a row of table
Parameter col: the colummn to remove
Precondition: col is an index (int) for a column of table
"""

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!