I created a list variable and assigned another variable to it. Then i modified the 2nd by adding a new item to it. I found out the 1st variable changed too. Just want to confirm that assignment does not create a new list.
list1=["v1", "v2"," v3"]
list2=list1
list2.insert[0, "id"]
so list2 output is: ["id", "v1", "v2"," v3"]
however list1 output is the same.
So i can't use assignment to create a new list from list1. rather i need to do this:
list1=["v1", "v2"," v3"]
list2=["id", "v1", "v2"," v3"]
i'd like to understand this better but i did not anything by searching online. Help please. Thanks.