Discuss / Python / FinMaxAndmin(L)

FinMaxAndmin(L)

Topic source

    if L==[]:

        return (None,None)

    else:

        b=c=L[0]

        for n in L:

            if b<n:

                b=n

            if c>n:

                c=n

        return(c,b)

厉害

云剑决

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

大牛,遍历一轮就出结果了

Shin爱读书

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

厉害

IE洗铁路

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

6


  • 1

Reply