another one that has me puzzled. (Sorry!)
this is my code, that seems to do what is asked but doesn't seem to avoid changing the original but, I make all modifications to a copy of it!
Is my copying faulty?
def remove_duplicates(temp_list): new_list = new_list = temp_list for i in temp_list: new_list.sort if new_list.count(i) > 1: new_list.remove(i) return new_list
I tried declaring the new list outside the function, inside, inside the loop but to no avail!
Any help welcome (and most needed).