Example 2:
s = [“Name“,”codewindow“,”Country“,”India“]
new = s.copy()
new.append(“State“)
print(“new_list”,new)
print(“old_list”,s)
Output:
new_list [‘Name‘, ‘codewindow‘, ‘Country‘, ‘India‘, ‘State‘]
old_list [‘Name‘, ‘codewindow‘, ‘Country‘, ‘India‘]
Explanation:
Here, any changes to the new list did not affect the old list as u can clearly see.