1. Engineering
  2. Computer Science
  3. write a python function copy that takes a 2dimensional list...

Question: write a python function copy that takes a 2dimensional list...

Question details

Write a Python function copy that takes a 2-dimensional list and returns a (deep) copy of it. First make sure you understand why the following code doesn’t work:

def copy(x):

return [x[i] for i in range(len(x))]

Use slicing to help make the copy.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution