311 B
311 B
title, type, language, tags, cover, dateModified
| title | type | language | tags | cover | dateModified | |
|---|---|---|---|---|---|---|
| Last list element | snippet | python |
|
lake-runner | 2020-11-02T19:28:05+02:00 |
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]
last([1, 2, 3]) # 3