== is

# 判断两个数据 值和内存地址是否相等
符号: ==(只判断值) is(判断内存地址)


s1 = ['jason', 'kevin', 'tony', 'jackson']
s2 = ['jason', 'kevin', 'tony', 'jackson']
print(s1 == s2) # True
# print(id(s1),id(s2))
print(s1 is s2) # False

 

posted @ 2024-03-22 17:02  tslam  阅读(2)  评论(0编辑  收藏  举报