i encountered a weird thing about the .sort() command in python 2.7.
to explain i'll use a simple code -
A = [1,3,2]
B = A
B.sort()
print A
in this code i create a non sorted list A, i then copy that list into B, sort B and print A. for some reason when i print A i get a sorted list [1,2,3] even though i used the sort command on B.
on the other hand if i'll write the following code -
A = [1,3,2]
B = A
B[1] = 123
print A
it'll print A as it should - [1,3,2]
if someone can suggest an explanation it'll be great thanks