Python: How can I edit a copy of a list independently? -


this question has answer here:

i have nested list a. let list b=list a. when try edit list b changing of elements using b[1][2]=2, list a[1][2] gets changed too.

why happen?

because assigning reference, list b pointing list a. have use copy of list. answered here:

python list value not reference


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -