Course
Python Programming
Slides for the weekly videos and for the in-person class. New decks appear here as the course progresses — bookmark this page.
- Lecture
Week 1 · Orientation and Setup: Your First Program
What a program is, why Python, and the three tools (editor · interpreter · terminal), plus how the course runs.
- Lecture
Week 2 · Numbers and Calculation
int and float, the seven arithmetic operators, order of operations, why 0.1 + 0.2 is not 0.3, and how print() turns an expression into a value.
- Practice
Week 2 · Practice: Numbers and Calculation
Task cards for the practice video: prompt drills, breaking things on purpose, a first calculation file, three worked examples, and the exercise 1 briefing.
- Class
Week 2 · Class: Numbers and Calculation
The in-person class after the week 2 videos: a six-slide recap, a what-comes-out quiz, the exercise 1 debrief, why an error is good news, and a first look at week 3.
- Lecture
Week 3 · Variables, Strings, and Input/Output
From a calculation to a program: a seven-line program that asks the user, remembers the answers, and answers in words, built step by step with variables, strings, input(), and f-strings.
- Practice
Week 3 · Practice: Variables, Strings, and Input/Output
Task cards for the practice video: prompt drills, breaking four things on purpose, the seven-line program as a file, three input programs, and the exercise 2 briefing.
- Class
Week 3 · Class: Variables, Strings, and Input/Output
The Monday class after the week 3 videos: six recap slides, a quiz at the prompt, exercise 2 solved live, = means store, and a first look at week 4.
- Lecture
Week 4 · Comparisons and Conditionals
A program that decides: a score comes in, the program checks that it is from 0 to 100, then picks a grade. Comparisons, True and False, if, else, and elif, not, and, or, and an if inside an if.
- Practice
Week 4 · Practice: Comparisons and Conditionals
Task cards for the practice video: prompt drills, the grade program as a file, breaking it four ways, three decision programs (even or odd, a tolerance checker, Celsius to F or K), and the exercise 3 briefing.
- Class
Week 4 · Class: Comparisons and Conditionals
The Monday class after the week 4 videos: eight recap slides, a quiz at the prompt, exercise 3 solved live, and a first look at week 5.
- Lecture
Week 5 · Loops: while and for
A program that repeats: it asks for each score, asks again until a score is from 0 to 100, and prints the average. while, for and range, adding up and counting, break and continue, and a loop inside a loop.
- Practice
Week 5 · Practice: Loops: while and for
Task cards for the practice video: loops traced on paper then run, the score average as a file, a first look at the debugger, breaking the program three ways, the highest score, three loop programs (digit sum, a number triangle, is it prime?), and the exercise 4 briefing.
- Class
Week 5 · Class: Loops: while and for
The class after the week 5 videos: eight recap slides, a quiz at the prompt, exercise 4 solved live, and a first look at week 6.
- Lecture
Week 6 · Functions
Lines with a name: week 4's grade check becomes grade(score), and report(subject, score) prints a line with it for three subjects. A function as a box with a value in and a value out, def and calls, parameters and arguments, return and None, default values and keyword arguments, and local variables.
- Practice
Week 6 · Practice: Functions
Task cards for the practice video: the report program as a file, stepping into a call inside a call with the debugger, breaking the program three ways, changing it in one place, three function programs (even numbers, factorial in the exercise's own setting, primes up to n), and the exercise 5 briefing with part of each file given.
- Class
Week 6 · Class: Functions
The class after the week 6 videos: ten recap slides, a quiz at the prompt, exercise 5 solved live, and a first look at week 7.
- Lecture
Week 7 · Lists and Tuples
Scores kept in a list instead of forgotten by the loop: a list, indexes and slices (for strings too), changing a list with methods, immutable strings and string methods, for and in over lists and strings, sum, min, max, sorted, split and join, two variables for one list, tuples and unpacking, swapping, and enumerate.
- Practice
Week 7 · Practice: Lists and Tuples
Task cards for the practice video: indexes and slices predicted at the prompt, the score program as a file, a list growing in the debugger, breaking the program three ways, three programs (vowels, the digit sum with a string, long words in the exercise's own setting), and the exercise 6 briefing.
- Class
Week 7 · Class: Lists and Tuples
The class after the week 7 videos: twelve recap slides, a six-item quiz, exercise 6 solved live, and the midterm next week.
- Lecture
Week 9 · Dictionaries and Sets
Scores found by name instead of by position: a dictionary of keys and values, KeyError, adding and changing, in and get, looping with keys, values() and items(), zip and dict(zip(...)), counting with a dictionary, nested lists and dictionaries, sets with union and intersection, choosing a container, and reading comprehensions.
- Practice
Week 9 · Practice: Dictionaries and Sets
Task cards for the practice video: the score program as a file, breaking it three ways (items(), values(), a missing key), three programs (a phone book, a word counter with the dictionary growing in the debugger, words grouped by first letter in the exercise's own setting), and the exercise 7 briefing.
- Class
Week 9 · Class: Dictionaries and Sets
The class after the week 9 videos: twelve recap slides, a six-item quiz, exercise 7 solved live, and modules and packages next week.