how to find second maximum element of an array python

maximum1 = max(lst) 
maximum2 = max(lst, key = lambda x: min(lst)-1 if (x == maximum1) else x)

Here is what the above code is Doing:
1. We create a list of integers, lst.
2. We find the maximum value in the list, maximum1.
3. We find the maximum value in the list, maximum2, but we exclude the value of maximum1.
4. We print the values of maximum1 and maximum2.