Christian Witts wrote: > def remove_coming_duplication(a_list): > return [element for idx, element in enumerate(a_list) if element != > a_list[idx-1]] Beware of negative indices: >>> remove_coming_duplication([1, 2, 1]) [2, 1] # should be [1, 2, 1]