zjfz-2019-s439462/intro/Task106.py
2020-01-12 14:35:16 +01:00

5 lines
143 B
Python

def penultimate(l: list, otherwise: object) -> object:
if (not l) or (len(l) == 1):
return otherwise
else:
return l[-2]