Discuss / Python / 交作业

交作业

Topic source

xinyujaychou

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

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


  • 1

Reply