Lists

What is a list?

A list is a collection of items in a specific order.

How do you define a list?

A list is defined using square brackets []. You access list items through their position in the list, or index. The first item is always index zero; a negative index accesses the list from the other end. Modify an element in a list using its index.

How do you add items to a list?

Use append() to add single items to the end of a list. Use insert() to insert items at any position using the index of that position.