Discuss / Python / 作业_迭代

作业_迭代

Topic source

落之萧萧

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

def findMinAndMax(L): if len(L) == 0: return (None, None) min = max = L[0] for i in L[1:]: if i < min: min = i elif i > max: max = i return (min, max)


  • 1

Reply