So I have to find the second largest number from list. I am doing it through simple loops.
My approach is to divide a list into two parts and then find the largest n
list1=[1,10,2,3,5,7,1,-32,90,99,99] max=0 secmax=0 for i in list1: if i>max: max=i for i in list1: if i>secmax and max!=i: secmax=i print(secmax)