Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Python

Idiom #291 Remove sublist

Delete all the elements from index i (included) to index j (excluded) from the list items.

del items[i:j]
s = slice(i, j)
items[s] = []
items[i:j] = []
items.removeRange(i, j);

New implementation...
< >
programming-idioms.org