Homework: Fix the Test Suite
作业: 修复测试套件
Four broken functions. Each has exactly one bug — and each bug is a pattern you've seen before. The course capstone.
The four bugs
| Function | Bug pattern | Where you've seen it |
|---|---|---|
letter_grade | elif chain in wrong order | Ch.2 Letter Grade |
fizzbuzz | append int instead of str | Ch.3 FizzBuzz |
word_starts_with | return instead of append | Ch.6 search vs filter |
bisect_count | off-by-one (missing + 1) | Ch.3 Sum 1..n |
The right fixes — for reference after submission
Python · runnable
Acceptance criteria
- All 14 tests pass
- Each fix is minimal — no rewriting from scratch
- No new bugs introduced — run all tests after each fix
🎓 You've reached the end
This is the last graded homework in CSC 141. After this you can write, read, and debug any first-semester Python program. Welcome to programming.