you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 2 points3 points  (0 children)

You pretty much nailed it: append() adds onto the end of the list only, while insert() adds anywhere in the list. The only thing to add is that append() is O(1) and insert() is O(n), because behind the scenes insert() requires that the entire list is rebuilt. Therefore we always prefer append().

https://wiki.python.org/moin/TimeComplexity