Quantcast
Channel: How do I clone a list so that it doesn't change unexpectedly after assignment? - Stack Overflow
Viewing all articles
Browse latest Browse all 117

List changes unexpectedly after assignment. Why is this and how can I prevent it?

$
0
0

While using new_list = my_list, any modifications to new_list changes my_list every time. Why is this, and how can I clone or copy the list to prevent it?


Viewing all articles
Browse latest Browse all 117

Trending Articles