Discuss / Python / 作业

作业

Topic source

roc风羿

#1 Created at ... [Delete] [Delete and Lock User]
    xMin = xMax = None
    from collections.abc import Iterable
    if isinstance(L, Iterable):
        if len(L) != 0:
            xMin = xMax = L[0]
            for i, value in enumerate(L):
                if xMin > value:
                    xMin = value
                if xMax < value:
                    xMax = value
    return (xMin, xMax)

  • 1

Reply