Python: Difference between append and ‘+=’ for lists
In many applications +=
and append
are interchangeable,
but for Python list
s they are not.
If you are append
ing a list
of list
s to another list
of list
s,
append
will only append
the first list
;
you need to use +=
in order to join all of the list
s at once.
Via Kaggle.com.
Leave a comment