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 >
As per the Python in-built function sorted
sorted
sorted(my_list)[0]
gives back the smallest number, and sorted(my_list)[1] does accordingly for the second smallest, and so on and so forth.
sorted(my_list)[1]