>>> dict = {}
>>> a=2
>>> if a is not None and dict is None:
... print("lol")
... else:
... print(" Print result is a")
...
result is a
为什么第一个if statement does not run? I am specifying that the
字典is empty and that
"a"` 存在。
参考:https ://docs.python.org/2/library/stdtypes.html#truth-value-testing