Discuss / Python / 作业

作业

Topic source

leo咕咕白

#1 Created at ... [Delete] [Delete and Lock User]

   le=len(L)  

    if le==0:

        return(None, None)

    elif le==1:

        return(L[0], L[0])

    else:

        max=L[0]

        min=L[0]

        for n in  L:

            if n>max:

                max=n

            if n<min:

                min=n

        return(min,max)


  • 1

Reply