Lists & Tuples
Hold many values under one name, in a changeable list or a fixed tuple, and process them with one loop instead of one variable each.
After this lesson you will be able to
- Create lists and tuples, and say which can change and why that matters.
- Use indexing, slicing, and the common list methods, and know which are slow.
- Copy a list correctly and explain why
b = adoes not copy. - Write list comprehensions and unpack lists and tuples into variables.
- Choose between a list and a tuple, including when a tuple is needed as a dictionary key.
Before you start. Python Basics: variables, loops and range.