increment_2D#
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 new 2D list with every element incremented by 1. This function should work regardless of the size of the 2D list. The original list should be unchanged. For this code challenge, don’t worry about empty lists.
For example, increment_2D([[1,2],[4,0],[-1]])
should return [[2,3],[5,1],[0]]
.