Discuss / Python / ol

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

if not isinstance(L, Iterable):

        raise TypeError("参数错误")

    max = None

    min = None

    for i in L :

        if not isinstance(i, (int, float)):

            continue

        if max == None:

            max = i

        if min == None:

            min = i

            continue

        if max < i:

            max = i

        if min > i:

            min = i

    return (min, max)


  • 1

Reply