Question: How do I do this in Python? Now, let's get some practice coding nested for loops for 2D lists. Define a function increment_2D that will
How do I do this in Python?

Now, let's get some practice coding nested for loops for 2D lists. Define a function increment_2D that will take as a parameter a 2D list of integers and returns a 2D list with every element incremented by 1. This function should work regardless of the size of the 2D list. For this code challenge, don't worry about empty lists. Sample Input 1: 8,1,3 2,3,4 1,2,4 Sample Output 1: 9,2,4 3,4,5 2,3,5 Sample Input 2: -1,-2 0,1 1,2 Sample Output 2: 0,-1 1,2 2,3 Correct answer from 157 learners Total 30% of tries are correct Write a program, test using stdin stdout Time limit: 15 seconds Memory limit: 256 MB 1 # Fill in your function increment_2D here 2 # Your function should return the updated 2d list 3 def increment_2D(list_2d): return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
