Python 比较 相等性 真值

1 == 操作符测试 值 的相等性; is 测试对象的一致性。注意短字符串的is相等性测试,PVM会缓存短字符串,s1 is s2 将返回true。

2 false:"", [], {}, 0.0, None; true:“s”, 1

原文地址:https://www.cnblogs.com/chenhuanBlogs/p/7716761.html