30 seconds of python

  Back to Home

last

listbeginner

Returns the last element in a list.

use lst[-1] to return the last element of the passed list.

def last(lst):
  return lst[-1]