Discuss / Python / 练习

练习

Topic source

def findMinAndMax(L): if len(L) == 0: return (None, None) mymax = L[0] mymin = L[0] for x in L: if x > mymax: mymax = x; if x < mymin: mymin = x return (mymin, mymax)

城南梦想

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

findMinAndMax([]) 报错呢


  • 1

Reply