== 和 is 的区别
x = y = [1, 2, 3] z = [1, 2, 3] print(x == y) # True print(x == z) # True print(x is y) # True print(x is z) # False print(id(x)) # 4416785008 print(id(y)) # 4416785008 print(id(z)) # 4416784504
x,y,z三个对象的值都是[1,2,3],所以在==的情况下都是True
x和y的id相同,所以x is y 为 True,而x和z的id不同,所以x is z 为 False