Discuss / Python / 作业

作业

Topic source

乔洪宝

#1 Created at ... [Delete] [Delete and Lock User]
    min = None
    max = None
    for v in L:
        if not min or v < min:
            min = v
        if not max or v > max:
            max = v
    return (min, max)

不错,这样省略了初始判空


  • 1

Reply