# Lists and Tuples

Keep many values in one place. You'll make lists, add and remove items, loop through them with for and enumerate, add them up with sum, min and max, take slices of lists and strings, and group fixed values into tuples you can unpack. Then you'll plan a road trip: its stops, its miles and its longest drive.

Updated: November 19, 2026

## [Lists in Python](https://www.ask-codey.com/courses/python-in-depth/topics/python-working-with-lists)

1. [Lists: Keeping Things in Order](https://www.ask-codey.com/lessons/python-lists) (Novice): A list keeps many values in order under one name, so you can read any item by its index, counting from 0 at the front or from -1 at the back, add, insert and remove items, and check whether a value is there with in.
2. [Looping Through a List](https://www.ask-codey.com/lessons/python-lists-looping-and-built-ins) (Apprentice): A for loop runs the same lines once for each item in a list, enumerate() numbers the items as it goes, sum(), min() and max() total and compare a list's numbers, and sorted() hands back a sorted copy while .sort() sorts the list itself.

## [Slices and Tuples](https://www.ask-codey.com/courses/python-in-depth/topics/python-slices-and-tuples)

1. [Slicing Lists and Strings](https://www.ask-codey.com/lessons/python-indexing-and-slicing) (Apprentice): A slice such as stops\[1:4\] takes part of a list or a string, from the start index up to but not including the stop index, with an optional step, and because a string can't be changed in place, you build a changed copy from slices instead.
2. [Tuples and Unpacking](https://www.ask-codey.com/lessons/python-tuples-and-unpacking) (Apprentice): A tuple groups a few values that belong together, such as a city and its miles, and can't be changed once made, and unpacking gives each value its own name in one line, which is how a function returns two values and how two variables swap.

## [Exercise: Road Trip Planner](https://www.ask-codey.com/courses/python-in-depth/topics/exercise-python-road-trip-planner)

1. [Exercise: Road Trip Planner](https://www.ask-codey.com/lessons/exercise-python-road-trip-planner) (Apprentice): Write the five functions behind a road trip planner, with lists, slices, tuples, unpacking and enumerate(), and let pytest's tests call each one to check what it returns.

Source: https://www.ask-codey.com/courses/python-in-depth/chapters/python-lists-and-tuples
