Unit 04 — Comparisons & Boolean Logic
Prerequisite: Unit 03 — parameters and return values
Learning goal: Build and combine True/False expressions using comparisons, and/or/not.
Work through the following four lessons in order. Each introduces a focused new skill, builds from earlier material, and includes a coded practice task. Review the example, predict its behavior, then use the browser editor to run and check your work.
| # | Lesson | New skill | Points |
|---|---|---|---|
| 1 | Ask Python a question | Comparison operators and Boolean values | 5 |
| 2 | Exact matches matter | Equality and inequality | 5 |
| 3 | Combine conditions | Logical operators | 10 |
| 4 | Build: Entry Check | Combining comparisons and logical operators | 15 |
Open the interactive lessons (Units 02–06). Browser checking is practice; submitted code is graded by GitHub Actions once the corresponding PR contains the new main.py file.
Learning reminders
- Write and run code yourself before revealing hints.
- Use print only in tasks that specifically require console output; for function challenges, use
return. - Explain your reasoning, including how a boundary or unusual input should behave.
- The first two tasks introduce skills, the third combines skills, and the final task is cumulative.