Discuss / Python / 判断是否可以用 not a 这样的,空的默认是False,not False 等于 True

判断是否可以用 not a 这样的,空的默认是False,not False 等于 True

Topic source

常常23333

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

-- coding: utf-8 --

def findMinAndMax(L): if not L: return (None,None) m,n = L[0],L[0] for key in L: if key <= m: m = key if key >= n: n = key return (m,n)


  • 1

Reply