Discuss / Python / 答案

答案

Topic source

Nb-Boom

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

    if not L:

        return(None, None)

    elif len(L) == 1:

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

    else:

        max=L[0]

        min=L[0]

        for i in L:

            if i > max:

                max = i

            if i < min:

                min = i

    return(min,max)


  • 1

Reply