Discuss / Python / 交作业20200129 2204

交作业20200129 2204

Topic source

    if len(L)==0:

        return (None, None)

    elif len(L)==1:

        return (L[0], L[0])

    else:

        x=L[0]

        y=L[0]

        for d in L:

            if d>x:

                x=d

            if d<y:

                y=d

        return (y, x)


  • 1

Reply