def penultimate(list, otherwise): if len(list) < 2: return otherwise else: return list[-2]