is和==的区别

is 比较的是内存地址
== 比较的是内容
当两个变量指向同一个对象的时候. is是True, ==也是True

猜你喜欢

转载自www.cnblogs.com/YangWenYu-6/p/10060819.html