Question: Python Problem: # Next, let us try to use the copy function of the list object thelist = [ 0, [10,11], [20, [[2100,2101],211]], 3] #

Python Problem:

# Next, let us try to use the copy function of the list object

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

thecopy2 = thelist.copy()

# Notice that dictionary also has a similar copy function. But tuples,

# being immutable, do not have, and do not need a copy function.

# ctuple = atuple this will all point to the sample tuple object

# memory location which is immutable.

#

# ###### QUESTION 2 QUESTION 2 QUESTION 2 ##########

# Run some codes to show that a this copy method is not a completely shallow copy

# Include some examples which show it is indepent of thelist

# and also some examples which show it is still tied to thelist

#

# write your codes here

#

# ###### END of QUESTION 2 ### END of QUESTION 2 ##########

'Python Problem: # Next, let us try to use the copy function

# Next, let us try to use the copy function of the list object thelist = [ 0, [10,11], [20, [[2100, 2101],211]], 3] # four-level deep thecopy2 = thelist.copy # Notice that dictionary also has a similar copy function. But tuples, # being immutable, do not have, and do not need a copy function. # ctuple = atuple this will all point to the sample tuple object # memory location which is immutable. # ###### QUESTION 2 QUESTION 2 QUESTION 2 ########## # Run some codes to show that a this copy method is not a completely shallow copy # Include some examples which show it is indepent of thelist # and also some examples which show it is still tied to thelist # write your codes here # ###### END of QUESTION 2 ### END of QUESTION 2 ##########

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!