Which allows changing b without affecting a:
a = [1, 2, 3] b = a[:] print id(a) print id(b) b[0] = 5 print id(a) print id(b) print a print b
which prints:
135445132 135367596 135445132 135367596 [1, 2, 3] [5, 2, 3]
represented by the state diagram (at the end of the program), i.e.
changing b
affects
a
: