Pankaj-Str/Complete-Python-Mastery

Python program to find second largest number in a list

Closed this issue · 2 comments

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])