If we take b = [1,2,3]
and if we try doing: b+=(4,)
It returns b = [1,2,3,4]
, but if we try doing b = b + (4,)
it doesn't work.
b = [1,2,3]
b+=(4,) # Prints out b = [1,2,3,4]
b = b + (4,) # Gives an error saying you can't add tuples and lists
I expected b+=(4,)
to fail as you can't add a list and a tuple, but it worked. So I tried b = b + (4,)
expecting to get the same result, but it didn't work.