`if not x:` 和`if x is not None:`和`if not x is None:`

主要有三种判断变量是否为None:python `if x is None`;  `if not x:`;   `if not x is None`(`if not (x is None)`) 。ide 在python中 None,  False, 空字符串"", 0, 空列表[], 空字典{}, 空元组()都至关于False ,即:spa [python]  view plain  copy <
相关文章
相关标签/搜索