Question: Write a function named swap_half that takes an input matrix (A), swaps its first half of the rows with the second half and returns the
Write a function named swap_half that takes an input matrix (A), swaps its first half of the rows with the second half and returns the resulting matrix (B). The code has already been provided to define a function named swap_ half that accepts input variable A. def swap_half(A): \#a\# Write the code for your function betow this line. return B In your code, make sure to use adequate loop(s). Example: Input Matrix: Output Matrix
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
