Discuss / Python / get

JorgeBowie

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

def findMinAndMax(L): if not L: return(None, None) max=min=L[0] for i in L: if i>max: max=i if i<min: min=i return(min,max)

if not L: xxx 是怎么判断的? 如果传的是列表,就相当于是true?

L 为空,就是false,not L就是true


  • 1

Reply