Skip to content
Related Articles

Related Articles

Python List append() Method

View Discussion
Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 04 Aug, 2021
View Discussion
Improve Article
Save Article

The Python List append() method is used for appending and adding elements to the end of the List

Syntax: list.append(item)

Parameters:

  • item: an item to be added at the end of the list

Returns:

The method doesn’t return any value 

Example 1: Adding an Item to the List

Python




# my_list
my_list = ['geeks', 'for']
  
# Add 'geeks' to the list
my_list.append('geeks')
  
print my_list


Output:

['geeks', 'for', 'geeks']

Example 2: Adding List to the List

Python




# my_list
my_list = ['geeks', 'for', 'geeks']
  
# another list
another_list = [6, 0, 4, 1]
  
# append another_list to my_list
my_list.append(another_list)
  
print my_list


Output:

['geeks', 'for', 'geeks', [6, 0, 4, 1]]

Note: A list is an object. If you append another list onto a list, the parameter list will be a single object at the end of the list.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!