I want to manipulate a List in python while keeping the original List untouched.
So I've substituted the Original List into a new defined variable as below :
Original_List = [1,5]
Substituted_List = Orginal_List
But I've noticed doing Substituted_List.append()
also modify the Original_List too:
Substituted_List.append(3)
print("Original list is: %s" %Original_List)
print("Substituted list is: %s" %Substituted_List)
The output is:
Original list is: [1,5,3]
Substituted list is: [1,5,3]
While the Original list is supposed to be: [1,5]