Question: Deepish Copy You saw in lecture the difference between a shallow copy and a deep copy. Write a function deepishCopy ( xx ) that takes
Deepish Copy
You saw in lecture the difference between a shallow copy and a deep copy.
Write a function deepishCopyxx that takes a list of lists xx and returns a deepish copy of that list. What we mean is that your function should create a new list and add shallow copies of everything to that list. So given
xx yy
deepishCopyxx will completely copy everything in xx
deepishCopyyy will completely copy and but the will be a shallow copy.
For the more technically inclined, this means you do not need recursion.
Running it we could get this behavior:
xx deepishCopyxx xx xxxx yy deepishCopyyy yy yy yyyy
Do not use the builtin deepcopy to do this. It will do too much.
Hint: the code typex list will be useful to you.
The setup code gives the following variables:
Your code snippet should define the following variables:
NameTypedeepishCopyfunction
usercode.py
def deepishCopyxx:
Restore original file
Save onlySave & Grade Unlimited attempts
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
