Discuss / Python / 最大最小

最大最小

Topic source

浪人桃

#1 Created at ... [Delete] [Delete and Lock User]
def findMinAndMax(L):    if not list:        return None, None    maxx = L[0]    minn = L[0]    for x in L:        maxx = max(maxx, x)        minn = min(minn, x)    return minn, maxx

  • 1

Reply