W WolfCode · CSC 141

Homework: Fix the Test Suite

作业: 修复测试套件

≈ 40 min · python-debugging · Open in WolfCode

Four broken functions. Each has exactly one bug — and each bug is a pattern you've seen before. The course capstone.

The four bugs

FunctionBug patternWhere you've seen it
letter_gradeelif chain in wrong orderCh.2 Letter Grade
fizzbuzzappend int instead of strCh.3 FizzBuzz
word_starts_withreturn instead of appendCh.6 search vs filter
bisect_countoff-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.