In [90]: lst = [1,2,3,6,3,4,5,4]
...:
...: max = -9999
...: secMax = -99999
...: for x in lst:
...:
...: if x > max:
...: max = x
...: if x > secMax and x < max:
...: secMax = x
...:
In [91]: print(max)
6
In [92]: print(secMax)
5