def findMinAndMax(L): if L == []: return (None, None) elif len(L) == 1: return (L[0], L[0]) else: tem = L[0] temp = L[0] for i in L: if i <= tem: tem = i for i in L: if i >= temp: temp = i return (tem, temp)
Sign in to make a reply
打不死的小怪兽zj