Discuss / Python / 作业

作业

Topic source

_盛盛_

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

def findMinAndMax(L): if len(L) == 0: return (None, None) for x in L: i = 0;j = 0; for y in L: if x >= y: i = i + 1 if x <= y: j = j + 1 if i == len(L): max = x if j == len(L): min = x return min, max


  • 1

Reply