jackfrued / Python-Core-50-Courses

Python语言基础50课

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

第10课:字符串的使用 is判断在python3.10.11中为True

sniperwang00 opened this issue · comments

s1 = 'hello world'
s2 = 'hello world'
s3 = s2

print(s1 == s2, s2 == s3) # True True
print(s1 is s2, s2 is s3) # False True

实际执行结果为:
True True
True True

应该是加入了字符串缓冲池导致的?

commented