In the first case, element = element + [0] you create a new list.
In the second case, the element + = [0], you modify the existing list.
Since the list of lists, a, contains pointers to elements, only changing the elements will actually make a difference. (That is, creating a new list does not change pointers in.)
This can be seen more clearly if we take a simple example showing how the lists work:
>>> a = [1, 2, 3] >>> b = a >>> a = [4, 5, 6] >>> a [4, 5, 6] >>> b [1, 2, 3] >>> a = [1, 2, 3] >>> b = a >>> a += [4, 5, 6] >>> b [1, 2, 3, 4, 5, 6] >>> a [1, 2, 3, 4, 5, 6]
Assigning a variable to a list simply assigns a pointer.