append() and insert()

You can add new items to a list using the append() and insert() methods .

>>> spam = ['cat', 'dog', 'bat']
>>> spam.append('moose')  # <- append
>>> spam
['cat', 'dog', 'bat', 'moose']
>>> spam.insert(1, 'chicken') # <- insert
>>> spam
['cat', 'chicken', 'dog', 'bat', 'moose']

Note the list is modified in place. Unlike a function it doesn’t always return a value.