Hi everyone,

I'm intrigued by the output of the following code, which was totally contrary 
to my expectations. Can someone tell me what is happening?

>>> myName = "Kevin"
>>> id(myName)
47406848
>>> id(myName[0])
36308576
>>> id(myName[1])
2476000

I expected myName[0] to be located at the same memory location as the myName 
variable itself. I also expected myName[1] to be located immediately after 
myName[0].
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to