1、is比较的是引用是否指向同一对象
a = [11,22,33] b = [11,22,33] print(a is b)
执行之后的结果如下
2、==比较的是两个值是否一致
a = [11,22,33] b = [11,22,33] c = a print(id(a)) print(id(b)) print(id(c)) print(a is b) print(a == c)
执行结果如下