Discuss / Python / homework

homework

Topic source

鸟人子川

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

def findMinAndMax(L):

    if len(L) == 0:

        return None, None

    min = max = L[0]

    for x in L:

        if x > max:

            max = x

        if x < min:

            min = x

    return min, max


  • 1

Reply