Discuss / Python / 交作业啦

交作业啦

Topic source

    if len(L) == 0:

        return (None, None)

    max = L[0]

    min = L[0]

    for x in L:

        if x > max:

            max = x

        if x < min:

            min = x

    return (min,max)


  • 1

Reply