== 和 is

作者:iohannes 发布时间: 2025-03-14 阅读量:9
a = 'hello world'
b = 'hello world'
a == b  #返回True 
a is b  #返回False 
  • is 判断是否是一个ID
  • == 判断内容是否相等