in a Python program, I need to define a list from another one, and the delete an element from the new list, it also removes it from the other list. does anyone know how to counter that ?
below, an example :
source = [4, 5, 6]
new = source
new.remove(5)
print(new) # output [4, 6] has wanted
print(source) # output [4, 6] but wanted [4, 5, 6]