def remove_duplicates(numbers): singles =  duplicates =  numbers.sort() i = (len(numbers) - 1) while i > 0: if numbers[i] == numbers [i - 1]: duplicates.append(numbers[i]) else: singles.append(numbers[i]) i -= 1 return singles
I am returning just the sorted list. I was expecting the while statement it iterate through the list starting with the last number. If the number directly behind it was the same after it was a duplicate then it goes to the duplicate list. If the number behind it is new it goes to the singles list. I have returned both the singles and duplicates lists at the end of the function and the are the same. I don't understand.