📜  python 2.7 检查变量是否为无 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:06.590000             🧑  作者: Mango

代码示例1
>>> NoneType = type(None)
>>> x = None
>>> type(x) == NoneType
True
>>> isinstance(x, NoneType)
True