problem description
Why does the operation on code_3 affect the value of code_2?
originally there is no relationship between the two.
the environmental background of the problems and what methods you have tried
I personally understand that I assign values in the first few lines of code and operate in the for loop without affecting the value of code--2, but my debug found that the value of code_2 has also changed. no, no, no.
I don"t know why this happens. Isn"t Python translated line by line? no, no, no.
related codes
/ / Please paste the code text below (do not replace the code with pictures)
code=[1,2,3,4,5]
code_1=code
-sharp
for i in code: -sharp code "A"
print(i)
for k in code_1:
print(k)
code_1.remove(i)
what result do you expect? What is the error message actually seen?
what I expect is that code and code_1 do not affect each other, but I have deleted the code1 element, why the code element will also be deleted.