Discuss / Python / 也来交作业

也来交作业

Topic source

耗子兽君

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

    if L == []: 

        return (None,None)

    else:

        max =min = L[0]

        for i in range(len(L)):

            if L[i] >= max:

                max = L[i]

            else:

                if  L[i] <= min:

                    min = L[i]

            i=i+1

        return (min,max)


  • 1

Reply