Discuss / Python / 练习-欢迎讨论

练习-欢迎讨论

Topic source

草莓Z葵

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

def findMinAndMax(L): if not isinstance(L, (list)): return("输入的不是列表参数,请输入正确的列表") else: if len(L) == 0: return "None None" max = min = L[0] for x in L: if x <= min: min = x elif x >= max: max = x return min, max


  • 1

Reply