希望有人可以解释以下差异:
>>> s1 = "Cyber security"
>>> s2 = "Cyber security"
>>> id(s1) == id(s1)
True
>>> id(s1) == id(s2)
False
>>> s1 = "cyber"
>>> s2 = "cyber"
>>> id(s1) == id(s2)
True
>>> s2 = "cyber "
>>> s2 = "cyber "
>>> id(s1) == id(s2)
False
为什么空格使 id() 为假,而没有空格的不同变量为真?