Python Append will add something to the end of your list. It can be anything, a number, object, dictionary, or even another list.
Append simply means “add this thing to the end of that thing.”
list.append(item)
For example if you had a list of [1,2,3] and you wanted to append “4” you would call list.append(4)
This one is also extremely common throughout the Python language and it’s libraries. In fact, it’s extremely popular as a part of fundamental coding languages in general.
Now you’ll know what it means when you see it in Pandas and Numpy.
Let’s take a look at a python append code sample
# Define a list with a few items in it
my_list = [1,2,3,4]
# Then add an item to the end of your list via append
my_list.append(5)
# View your output
my_list
# Did you know that you could add a bunch of different data types to a list
my_dict = {"my_key" : "my_value"}
my_list2 = [10,11,12]
my_string = "My String!"
my_float = 4.5643
my_list.append(my_dict)
my_list
# Or you can add a list of items to a list
my_list.append(my_list2)
my_list.append(my_string)
my_list.append(my_float)
my_list
Check out more Python Vocabulary on our Glossary Page