Module 1 · 6 lessons · about 7 hours 50 minutes
Python, one step at a time
Names and values, lists and indexes, loops that walk a list, decisions and functions, strings, tuples, dicts and the everyday toolkit, and reading code line by line until state is never a mystery.
- Lessons
- 0/6
- Exercises
- 0/44
- Code
- 0/9
- Problems
- 0/9
- Checkpoint
- Not taken
Already comfortable with this? Take the checkpoint cold. If you pass, move on and come back only for what you missed.
- 1Names, values and listsA name is a tag tied to a value, and `=` moves the tag. A list is a row of numbered boxes you can read, slice and change, and two names can share one list, which is sometimes what you want and sometimes a bug.1 h 10 min
- 2Walking a listA for loop visits every item in a list, one at a time. Keep one or two values in a notebook as you go, and running totals, counts and maximums all turn out to be the same small program.1 h 50 min
- 3Decisions and functionsCode chooses with if, elif and else, and combines tests with and, or and not. A function wraps the choice in a name, hands back one value with return, and can stop a walk the moment the answer is known.1 h 25 min
- 4StringsA string is a row of characters that never changes. You read it like a list, walk it from either end, and build new strings from a list of pieces.1 h 5 min
- 5Tuples, dicts and the toolkitThe small tools that make Python code short: tuples and unpacking, dicts that look up a value by its key, sorting with a key, and one-line versions of loops you already know.1 h 5 min
- 6Reading code like a computerA computer runs one line at a time and keeps a value for every name. Do the same on paper and you can find bugs without a run button. This lesson covers trace tables, six common bugs, tracebacks, and a four-move debugging loop.1 h 15 min
- Checkpoint12 questions. Pass with 80% to finish the module.
Problems for this module
The lessons teach some of these step by step (each says which). The rest are practice: try each in its target time, and solved problems come back for spaced re-solves.