I read Python list + list vs. list.append(), which is a similar question, but my question is more in relation to the code below
a = [[]] * 4 b = [[]] * 4 a[3] = a[3] + [1] b[3].append(1) print a, b Which gives:
[[],[],[],[1]] [[1],[1],[1],[1]] Why would these 2 be any different? I've never run into an example like this where these 2 methods have different outputs...
Thanks