I want to add the values of temp list into the main list. I tried to add some values into the temp list and then append the temp list into the main list as following, but it shows always latest values in the main list.
>>> temp =[]
>>> temp.append(123)
>>> temp.append(10)
>>> temp.append(18)
>>> mutR =[]
>>> mutR.append(temp)
>>> print mutR
[[123, 10, 18]]
>>> temp[:]=[]
>>> temp.append(3)
>>> temp.append(4)
>>> temp.append(5)
>>> mutR.append(temp)
>>> print mutR
[[3, 4, 5], [3, 4, 5]]
My expectation is:
>>> print mutR
[[123, 10, 18], [3, 4, 5]]
but it is [[3, 4, 5], [3, 4, 5]]
.