How do I clone a list so that it doesn't change unexpectedly after assignment?
How do I clone a list so that it doesn't change unexpectedly after assignment? Question: 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? Asked By: aF. || Source Answers: Use thing[:] >>> a = [1,2] …