>>> x = 1>>> not xFalse>>> x = [1]>>> not xFalse>>> x = 0>>> not xTrue>>> x = [0] # You don't want to fall in this one.>>> not xFalse在python中 None, False, 空字符串"", 0, 空列表[], 空字典{}, 空元组()都相当于False ,即:
not None == not False == not '' == not 0 == not [] == not {} == not ()
not None == not False == not '' == not 0 == not [] == not {} == not ()

if a != None:
其意思是a!=none,则执行:后面的语句