Discuss / Python / 打卡打卡

打卡打卡

Topic source
def findMinAndMax(L):    if L == []:        return (None, None)    elif len(L) == 1:        return (L[0], L[0])    else:        tem = L[0]        temp = L[0]        for i in L:            if i <= tem:                tem = i        for i in L:            if i >= temp:                temp = i    return (tem, temp)

  • 1

Reply