Why does appending to one list also append to all other lists in my list of lists? [duplicate]

[[]]*2 is a list of two references to the same list. You are appending to it and then seeing it twice.

Leave a Comment