I'm having trouble getting the output I want. I want to create a list and have the first element of a new list be that initial list. Then I want to modify the first list, and have the new modified version of that list be the second element of the new list. Right now, this outputs [[2,3,4,5,5],[2,3,4,5,5]]. How would I modify it so that the output is [[1,2,3,4,5], [2,3,4,5,5]]?
noChange = [1,2,3,4,5]
lotsOfLists = []
lotsOfLists += [noChange]
for i in range(4):
noChange[i] += 1
lotsOfLists += [noChange]
print(lotsOfLists) # current output: [[2, 3, 4, 5, 5], [2, 3, 4, 5, 5]]
# WANT: [[1,2,3,4,5], [2,3,4,5,5]]