Chapter 02
Conditionals
条件分支
Make decisions: if / elif / else, comparison and logical operators, and the order-of-branches trap. Strictly aligned with Think Python §5.1–§5.6.
Strict source: Think Python §5.1–§5.6 (Boolean Expressions · Logical Operators · Conditional / Alternative / Chained / Nested Conditionals).
Lessons in this chapter
- 02.00 Worked ExampleWalkthrough: Sign of a Number例题: 数的正负号python-conditionals8 min
- 02.01 ExerciseLetter Grade等级字母python-conditionals15 min
- 02.02 ExerciseBMI Category体重指数分类python-conditionals15 min
- 02.03 ExerciseLeap Year闰年判断python-conditionals15 min
- 02.04 HomeworkHomework: Tax Bracket Calculator作业: 阶梯税率计算器python-conditionals35 min