till now I belived that Python strings are immutable but when I tried this I got confused
>>> a
'hello world !'
>>> id(a)
140521043795728
>>> a+="d"
>>> id(a)
140521043795728
>>> a+="d"
>>> id(a)
140521043795728
>>> a
'hello world !dd'
if I use +=
operator, it doesn't change the object id although string has changed. what is happening in this case?
now this is bit different? https://ideone.com/eg1SIN
can somebody explain what is happening here?