I have created a nested list l=[[-1]]*5 Now i want to append at position 2. How can I?
what happens
l = [[-1]]*5
>>> l
[[-1], [-1], [-1], [-1], [-1]]
>>> l[2].append(4)
>>> l
[[-1, 4], [-1, 4], [-1, 4], [-1, 4], [-1, 4]]
what I want is to append only at index2
>>> l
[[-1], [-1], [-1, 4], [-1], [-1]]