Interview Kickstart has enabled over 21000 engineers to uplevel.
## Introduction to Append and Extend in Python Python offers many useful built-in functions, two of which are `append()` and `extend()`. These functions are used to add elements to an existing list. The `append()` method adds a single element to the end of a list, while the `extend()` method adds multiple elements to the end of a list. When using `append()`, the elements are added as a single entity; when using `extend()`, each element of the iterable object (e.g. list, string, etc.) is added to the end of the list. In this article, we will discuss the differences between `append()` and `extend()`, when and how to use them and their various applications.
Attend our webinar on
"How to nail your next tech interview" and learn
**Append** Append is a built-in method in Python that allows us to add elements to the end of a list. Syntax: list.append(element) Example: myList = [1, 2, 3] myList.append(4) print(myList) Output: [1, 2, 3, 4] **Extend** Extend is another built-in method in Python that allows us to add multiple elements to the end of a list. Syntax: list.extend(list2) Example: myList = [1, 2, 3] list2 = [4, 5, 6] myList.extend(list2) print(myList) Output: [1, 2, 3, 4, 5, 6]