def findMinAndMax(L): if not isinstance(L, Iterable): raise TypeError('not Iterable type') a, b = None, None for i in L: if not isinstance(i, (int, float)): raise TypeError('not number type') if a is None or i < a: a = i
if b is None or i > b: b = i return a, b
Sign in to make a reply
疯子_20990
def findMinAndMax(L): if not isinstance(L, Iterable): raise TypeError('not Iterable type') a, b = None, None for i in L: if not isinstance(i, (int, float)): raise TypeError('not number type') if a is None or i < a: a = i