Answers for "example of deep copy in python"

0

example of deep copy in python

old_list = [[1, 2, 3], [4, 5, 6], [7, 8, 'a']]
new_list = old_list

new_list[2][2] = 9

print('Old List:', old_list)
print('ID of Old List:', id(old_list))

print('New List:', new_list)
print('ID of New List:', id(new_list))
Posted by: Guest on October-27-2021

Python Answers by Framework

Browse Popular Code Answers by Language