def last(iterable):
for item in iterable:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>return item<EOL><DEDENT>except NameError:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>
Return the last item from the iterable, discarding the rest.

>>> last(range(20))
19
>>> last([])
Traceback (most recent call last):
...
ValueError: Iterable contains no items