Try new_list = a[0:2] + [a[4]] + a[6:] .
Or, in general, something like this:
from itertools import chain new_list = list(chain(a[0:2], [a[4]], a[6:]))
This also works with other sequences and is likely to be faster.
Or you can do it:
def chain_elements_or_slices(*elements_or_slices): new_list = [] for i in elements_or_slices: if isinstance(i, list): new_list.extend(i) else: new_list.append(i) return new_list new_list = chain_elements_or_slices(a[0:2], a[4], a[6:])
But be careful, this will lead to problems if some of the items in your list are themselves lists. To solve this problem, either use one of the previous solutions, or replace a[4] with a[4:5] (or more generally a[n] with a[n:n+1] ).
source share