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
alist=[-45,0,3,10,90,5,-2,4,18,45,100,1,-266,706] sorted_list = sorted(set(alist)) sorted_list.pop() print(max(sorted_list))