I have a question regarding String concept in Python. From my understanding Strings are an immutable part of the language. For instance:
a = 'Emiliano'
a[0] = 'r'
print(a)
Result:
Type Error: 'str' object does not support item assignment
So, I know that I need to create another variable, but why in the following case doesn't Python retrieve any error if I am changing the whole string of the variable?
a = 'Emiliano'
a = 'David'
print(a)
Result: David