Jun-29-2018, 09:15 PM
Hi everybody,
I am starting to learn Python in these days: I came across the topic of shared references and equality, and I thought I had understood its basics. However, I came across an example where things were not so clear to me.
Here it is:
I am starting to learn Python in these days: I came across the topic of shared references and equality, and I thought I had understood its basics. However, I came across an example where things were not so clear to me.
Here it is:
a = 'a' b = 'b' ab = 'ab' a is 'a' # returns True b is 'b' # returns True ab is 'ab' # returns FalseWhy does the 3rd statement return false? Is it linked to the lenght of the string 'ab'? Thanks for helping