append is a Python list method for adding one object to the end of an existing list. It changes the list in place and is suited to adding a single item. section 5.3
Keep these rules in mind:
- Call it with dot notation: list.append(object). The argument becomes one element at the list's end. section 5.3
- Appending another list adds that list as a nested element rather than merging its contents. section 5.3
- Use extend when the elements of one list should be added individually to another list. section 5.3
- Use slice assignment when you need an alternative that appends several elements or performs broader list edits. section 5.3
Add one item
Starting with x = [1, 2, 3], the call x.append("four") produces [1, 2, 3, 'four'].
Avoid accidental nesting
With x = [1, 2, 3, 4] and y = [5, 6, 7], x.append(y) produces [1, 2, 3, 4, [5, 6, 7]], whereas x.extend(y) produces [1, 2, 3, 4, 5, 6, 7].

