I'm initializing these two lists and trying to replace the first 3 items in each list in two different ways.
b = c = [2, 4, 6, 8, 10, 12]
print(b)
b[0] = 3; b[1] = 6; b[2] = 9
print(b)
c[0:2] = [3,6,9]
print(c)
but when I run the code I get the weird output below. I get what i expect for "b" but something totally expected for "c". Can someone explain to me why this is happening?
b = [2, 4, 6, 8, 10, 12]
c = [2, 4, 6, 8, 10, 12]
new b = [3, 6, 9, 8, 10, 12]
new c = [3, 6, 9, 9, 8, 10, 12]