| append() method | extend() method |
|---|---|
The append() method adds a single item to the end of the list. The single element can be list, number, strings, dictionary etc. | The extend() method adds one list at the end of another list. |
The syntax is list.append(item). | The syntax is list.extend(list1). |
| For example, list1 = [1, 2, 3] list1.append(4) print(list1) | For example, list1 = [1, 2, 3] list1.extend([4, 5]) print(list1) |