Discuss / Python / 有人直接min(L)、max(L)是真的秀

有人直接min(L)、max(L)是真的秀

Topic source

Superb来了

#1 Created at ... [Delete] [Delete and Lock User]
if L==[]:    
    return (None, None)
else:
    max=L[0]
    min=L[0]   
    for i in L:
        if i>=max:
            max=i
        elif i<=min:
            min=i
    return(min,max)

  • 1

Reply