Question: Write a function process _ matrix ( matrix ) that takes a 2 D list ( matrix ) as input. The function should add 1

Write a function process_matrix(matrix) that takes a 2D list (matrix) as input. The function should add 1 to all odd numbers and subtract 1 from all even numbers in the matrix. The function should return the modified matrix. Hint: you can call your 'is_even' function from question 4. Inputs: matrix (2D list of integers)
Outputs: Modified matrix (2D list of integers)

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 Programming Questions!