<Below this line, add a link to the EXACT exercise that you are stuck at.>
<In what way does your code behave incorrectly? Include ALL error messages.>
remove_duplicates([4, 5, 5, 4]) resulted in an error: list index out of range
<What do you expect to happen instead?>
Index should not go out of range.
def remove_duplicates(numbers): new_list =  for index in numbers: new_list.append(numbers) if (numbers[index] == numbers[index-1] and index != 0): new_list.append(numbers[index]) return new_list
Can’t able to figure out how to keep the index within the range? Because to compare two consecutive elements I need to use index-1 or index+1. Both of the times index is going out of range.
Also, should I remove the duplicate elements along with copying the elements into a new list?