Question: Python Question: # Suppose we have a deep-list, which is a potentially a list of list of list of... thelist = [ 0, [10,11], [20,

Python Question:

# Suppose we have a "deep-list", which is a potentially a list of list of list of...

thelist = [ 0, [10,11], [20, [[2100,2101],211]], 3] # four-level deep

# We will try to write a recursive function to perform, and return a deep-copy of thelist

#%%

# ###### QUESTION 1 QUESTION 1 QUESTION 1 ##########

# But first, repeat what we did in class (if you had been taking notes...)

# Run some codes to show that a regular simple copying is only a shallow copy

thecopy = thelist

# example: thecopy[0] = ... etc

#

# write your codes here

#

# ###### END of QUESTION 1 ### END of QUESTION 1 ##########

Python Question: # Suppose we have a "deep-list", which is a potentially

'Run Cell Run Above Debug cell # Suppose we have a "deep-list", which is potentially a list of list of list of... thelist = [0, [10,11], [20, [[2100, 2101], 211]], 3] # four-level deep # We will try to write a recursive function to perform, and return a deep-copy of thelist Run Cell | Run Above | Debug cell # ###### QUESTION 1 QUESTION 1 QUESTION 1 ########## # But first, repeat what we did in class # Run some codes to show that a regular simple copying is only a shallow copy thecopy = thelist # example: thecopy [0] = ... etc # write your codes here # ###### END of QUESTION 1 ### END of QUESTION 1 ##########

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!