if len(L) == 0: return (None, None) elif len(L) > 0: mintemp = L[0] maxtemp = L[0] for i in L: if i > maxtemp: maxtemp = i elif i < mintemp: mintemp = i return (mintemp, maxtemp)
List判等需要import operator后调用operator.eq(a,b)方法。
Sign in to make a reply
慧眼的安娘娘
List判等需要import operator后调用operator.eq(a,b)方法。