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
Here is my program, irrespective of complexity
if __name__ == '__main__': alist=[-45,0,3,10,90,5,-2,4,18,45,100,1,-266,706] alist1 = [ ] [alist1.append(x) for x in alist if x not in alist1] alist1.sort() print alist1[-2]