append() and extend() in PythonLast Updated : 16 Feb 2026 In Python, there are two options to join the list which are the append() and extend() methods. To read more Python List The append() MethodThe append () method is used to add the elements from one list to the end of another list. Syntax:To read more Python List append() Method Example: Appending Elements to the ListLet's see a practical use of the append() method by joining the lists. ExampleCompile and RunOutput: ['We ', 'are', 'learning'] ['We ', 'are', 'learning', ['Append', 'Extend', 'in Python']] Explanation In the above example, we have used the append() method to add elements to the list. When a list is passed to append(), it does not add each item separately. Instead, it adds the entire list as a single element at the end of the original list. Using the append() Method with a for LoopWe can use the for loop with the append() method to add the elements from one list to the end of another list. Syntax: Here,
Parameter: The method accepts element as parameter. A loop variable that temporarily holds each item from list2 during the iteration. Return Value: A new list is not returned. The original is modified with new elements from the second list. Example: Appending List Using for Loop Let's take an example where we will be using the append() method with the for loop. ExampleCompile and RunOutput: ['MarutiSuzuki', 'Tata', 'Hyundai', 1, 2, 3] Explanation In the above example, we have the first list named car and the second list named rank. A for loop is used along with the append() method to add the elements of the rank list into the car. Finally, the updated list is printed, which contains both car names and numbers. The extend() MethodIn Python, the extend() method is used to join or concatenate the elements from one list to the end of another list. It is one of the simplest methods to join distinct lists. Syntax:Here,
Return Value: It does not return any new list. To read more Extending a List in Python Example: Extending to a ListLet's see an example, where we will use the extend method to add elements of the second list to the first list. ExampleCompile and RunOutput: ['MarutiSuzuki', 'Tata', 'Hyundai', 1, 2, 3] Explanation In the above example, we have used the extend method to add the elements of the second list to the end of the elements of the first list. No new list is created; only the first, or original, list named car is modified by adding the elements from the second list named rank. Differences Between append() and extend() Method
ConclusionIn this tutorial, we learnt that there are two methods to join the elements of distinct list which are the append() and extend() methods. Both methods have different functionalities and use cases, such as the append method, which adds a single element at the end of the list, whereas the extend method adds multiple elements from the second list to the first list. We have used examples, output, and explanation to understand the topic in depth. |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India