zjfz-2019-s402281/intro/Task106.py

15 lines
208 B
Python
Raw Normal View History

2020-01-12 13:16:55 +01:00
#!/usr/bin/python2
2020-01-12 13:11:00 +01:00
# -*- coding: utf-8 -*-
"""Rozwiązanie zadania 106."""
2020-01-12 15:16:54 +01:00
def penultimate(list,otherwise):
if len(list)<=1:
obj = otherwise
else:
n = len(list)
n = n-2
obj = list[n]
return obj
2020-01-12 13:16:55 +01:00