>>> a = "asd"
>>> b = "asd"
>>> id(a), id(b)
(54742848, 54742848)
>>> a = "asd!"
>>> b = "asd!"
>>> id(a), id(b)
(52458624, 54742016)
>>>
Why did python creat different objects in case of "asd!" while keeping the reference same for "asd"? In general, addition of a special character to the string changes the interning behavior. Is that a rule by itself?