I found this code on this site to find the second largest number:
def second_largest(numbers): m1, m2 = None, None for x in numbers: if x >
You can use in built function 'sorted'
def second_smallest(numbers): count = 0 l = [] for i in numbers: if(i not in l): l.append(i) count+=1 if(count==2): break return max(l)