My mind is confused. Why argument(L) changed here, shouldn't it be preserved?
L = [5,2,1,1,2,4,3,5]
def get_unique_list(list):
for values in list:
index=list.index(values)
for values2 in list[index+1:]:
if values==values2:
del list[list.index(values2)]
get_unique_list(L)
print(L)
output is
[1, 2, 3, 4, 5]