7. Lists
So far we have used variables to store a single value. Sometimes it is useful to store multiple values into a single variable using a list.
You can add an item into a list using the append
function
Items in a list can be retrieved as follows:
You can also perform different functions on a list, such as sorting, and finding maximum, minimum and length (number of items):
Last updated
Was this helpful?