Within my function, I need to change the value of an element in a list to a default (of 10) without changing the original list.
function(orig_list):
dup_list = list(orig_list)
#Setting the appropriate value for the list but don't want to change the original list.
for i in dup_list:
if dup_list[dup_list.index(i)][1] == 11 or dup_list[dup_list.index(i)][1] == 12 or dup_list[dup_list.index(i)][1] == 13:
dup_list[dup_list.index(i)][1] = 10
However, when I call the function in my code later on and print the original list, its also changed. I want the function to do this operation and give me a value but not change the original list.