List.append() changing all elements to the appended item [duplicate]
问题 This question already has answers here : Why does foo.append(bar) affect all elements in a list of lists? [duplicate] (3 answers) Closed 2 years ago . I seem to have a problem with my maze generating program made in Python. I'm trying to randomly create a path that branches out at select points, with the points getting stored as it goes along. When the maze gets to a dead end, it will sort back through the visited points by testing the top value than popping that and going to the next one,