I am trying to make a list of 5 lists.
I did that by web = [[]]*5
Now I want to update the first list in the 'list of lists' with values 1 and 2.
web[0].append(1)
web[0].append(2)
But my output is
[[1, 2],
[1, 2],
[1, 2],
[1, 2],
[1, 2],
[1, 2],
[1, 2],
[1, 2],
[1, 2],
[1, 2]]
But shouldn't the first list be updated only? My desired output is as below
[[1, 2],
[],
[],
[],
[],
[],
[],
[],
[],
[]]