How can a non-assigned string in Python have an address in memory?
问题 Can someone explain this to me? So I've been playing with the id() command in python and came across this: >>> id('cat') 5181152 >>> a = 'cat' >>> b = 'cat' >>> id(a) 5181152 >>> id(b) 5181152 This makes some sense to me except for one part: The string 'cat' has an address in memory before I assign it to a variable. I probably just don't understand how memory addressing works but can someone explain this to me or at least tell me that I should read up on memory addressing? So that is all well