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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -