Discuss / Python / my answer

my answer

Topic source

Cao Yi

#1 Created at ... [Delete] [Delete and Lock User]
def findMinAndMax(al):
    if len(al) == 0:
        return (None, None)
    
    min = al[0]
    max = al[0]
    for e in al:
        if max < e:
            max = e
        if min > e:
            min = e
    return (min, max)

  • 1

Reply