Write a pure Python function to add a scalar to every element of a 2D list and return a new list.
Constraints
Example
['>>> add_scalar_to_all([[1, 2], [3, 4]], 10)', '[[11, 12], [13, 14]]', '>>> grid = [[1, 2], [3, 4]]', '>>> add_scalar_to_all(grid, 10)', '[[11, 12], [13, 14]]', '>>> grid', '[[1, 2], [3, 4]]']
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints