name = None print(name,type(name)) #判断变量是否 None 不能用type和isinstance # print(isinstance(name,NoneType)) # print(type(name)==NoneType) # print(isinstance(name,'NoneType')) # print(type(name)=='NoneType') #用is 判断 NoneType类型 不行 # print(type(name) is 'NoneType') print(name is None) print(name is not None)