Discuss / Python / 第十五天打卡

第十五天打卡

Topic source

Mx

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

def findMinAndMax(L):

    if len(L) == 0:

        return (None, None)

    else:

        max = L[0]

        min = L[0]

        for x in L:

            if x > max:

                max=x

            if x < min:

                min=x

        return min,max


  • 1

Reply