Practice Makes Perfect, remove_duplicates
error message: Your remove_duplicates modifies the list that was passed to it. [4, 5, 5, 4] was modified to [5, 4]. Perhaps you should make a copy first!
I don't understand why I'm getting this error. I am not modifying the original list.
def remove_duplicates(lst): other_lst = lst answer =  for number in other_lst: if other_lst.count(number) > 1: answer.append(number) other_lst.remove(number) else: answer.append(number) return answer