`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 <
相關文章
相關標籤/搜索