Код: Выделить всё
def getMax(listy):
result = listy[0]
for i in range(1, len(listy)):
if listy[i] > result:
result = listy[i]
return result
def getSecondLargest(l):
for i in range(len(l)):
if l[i] == getMax(l):
l.pop(i)
return l
list1 = [20,10,11,12,3]
print(getSecondLargest(list1))
Код: Выделить всё
IndexError: list index out of range
Подробнее здесь: https://stackoverflow.com/questions/791 ... inted-them