Common List Operations
In this lesson, we'll take a look at some of the properties and utilities that come with the list data structure.
We'll cover the following
Adding Elements #
All the elements of a list cannot always be specified beforehand and there’s a strong possibility that we’ll want to add more elements during runtime.
The append()
method can be used to add a new element at the end of a list
. The following template must be followed:
a_list.append(newElement)
Here’s an example:
Get hands-on with 1200+ tech skills courses.