Skip to content

Home

List head

Returns the head of a list.

def head(lst):
  return lst[0]

head([1, 2, 3]) # 1

More like this

Start typing a keyphrase to see matching snippets.