Discuss / Python / 作业

作业

Topic source

wenyizhen

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

def findMinAndMax(L): if len(L) == 0: return (None,None) maxNum = L[0] minNum = L[0] for n in L: if n > maxNum: maxNum = n if n < minNum: minNum = n return (minNum,maxNum)


  • 1

Reply