second max from list python

Solutions on MaxInterview for second max from list python by the best coders in the world

showing results for - "second max from list python"
Marco
02 Jun 2017
1# Python program to find largest
2# number in a list
3 
4# list of numbers
5list1 = [10, 20, 4, 45, 99]
6 
7# sorting the list
8list1.sort()
9 
10# printing the second last element
11print("Second largest element is:", list1[-2])
12