Python - Find second smallest number

前端 未结 16 1223
长发绾君心
长发绾君心 2020-11-28 10:35

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 >         


        
16条回答
  •  情书的邮戳
    2020-11-28 11:29

    I am writing the code which is using recursion to find the second smallest element in a list.

    def small(l):
     small.counter+=1;
     min=l[0];
    
     emp=[]
    
     for i in range(len(l)):
        if l[i]

    You can test it with various input integers.

提交回复
热议问题