Oops, try again. 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!
In the second line I made a copy of the input and only modify the copy, so I don't understand why I'm getting this error.
def remove_duplicates(lst): copy = lst count_a = len(copy) - 1 while count_a >= 0: count_b = count_a - 1 while count_b >= 0: if copy[count_b] == copy[count_a]: copy.remove(copy[count_b]) count_a -= 1 count_b -= 1 else: count_b -= 1 count_a -= 1 return copy