Why does "hello" is "hello"
produce True
in Python?
I read the following here:
If two string literals are equal, they have been put to same memory location. A string is an immutable entity. No harm can be done.
So there is one and only one place in memory for every Python string? Sounds pretty strange. What's going on here?
id
function for checking memory locations:print id("hello")
– Blixt