Complete-Python-Mastery
Complete-Python-Mastery copied to clipboard
Python program to find second largest number in a list
Example : Data [ 10 , 2 , 4 , 5 , 7 , 8 , 9 , 5 ]
Second largest number = 9
Data = [ 10 , 2 , 4 , 5 , 7 , 8 , 9 , 5 ]
Data.sort()
print("Second largest element is:", sorted(Data)[-2])