5 lines
143 B
Python
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] |