Skip to content

Home

Drop list elements from the left

Returns a list with n elements removed from the left.

def drop(a, n = 1):
  return a[n:]

drop([1, 2, 3]) # [2, 3]
drop([1, 2, 3], 2) # [3]
drop([1, 2, 3], 42) # []

More like this

Start typing a keyphrase to see matching snippets.