Discuss / Python / 测试

测试

Topic source

WALL_E91

#1 Created at ... [Delete] [Delete and Lock User]

def findMinAndMax(l): if len(l) != 0: a = l[0] for x in l: if a >= x: a = x

    b = l[0]
    for y in l:
        if b <= y:
            b = y

    return (a, b)
else:
    return (None, None)

  • 1

Reply