Discuss / Python / 练习

练习

Topic source
if len(L) == 0: 
    return (None, None)  
else:
    max=L[0]
    min=L[0]
    for value in L:
        if value>max:
            max=value
        if value<min:
            min=value
    return (min,max)

  • 1

Reply