30 seconds of python

  Back to Home

head

listbeginner

Returns the head of a list.

use lst[0] to return the first element of the passed list.

def head(lst):
  return lst[0]