create list copy python code example
Example 1: copy a list python
new_list = old_list.copy()
# or
new_list = old_list[:]
Example 2: how to copy list python
new_list = old_list.copy()
# Above new_list does not get affected when modifying old_list
new_list = old_list
#Here new_list is also affected if any modifications are made to old_list