Discuss / Python / 有待优化

有待优化

Topic source

惟莉V雅爱

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

def findMinAndMax(l): if l == []: return 'No answer' else: m = n = l[0] for i in l: if i >= m: m = i if i <= n: n = i return m,n print(findMinAndMax([1,2,8,4,233,5,14,-325,13]))


  • 1

Reply