I need help understanding the following code:
**Example 1**
v1 = v2 = ['h', 'e', 'l', 'l', 'o']
v1 += ['w', 'o', 'r', 'l', 'd']
print(v1==v2) #True, v1 and v2 reference the same object
**Example 2**
v1 = v2 = ['h', 'e', 'l', 'l', 'o']
v1 = v1 + ['w', 'o', 'r', 'l', 'd']
print(v1==v2) #False, v1 and v2 no longer reference the same object
Question:
From my understanding, a += 1 is the same as a = a + 1.
Why then, is v1 += ['w', 'o', 'r', 'l', 'd'] different from v1 = v1 + ['w', 'o', 'r', 'l', 'd']?