TryBugHunt

#30DaysOfDebugging

30 Days of Debugging: Python

One bug a day, for 30 days. Each day is a short piece of Python that almost works, the symptom it causes, and tests that pass once you have fixed it. It takes most people five to ten minutes.

The first three weeks are the bugs every beginner meets. The last stretch is medium level: boundaries, rounding, shared state and an interview problem. Go faster if you like; the days are a pace, not a lock.

Your progress

0 of 30 days

Start Day 1 →
  1. 1Day 1 · Last letter crashes with IndexError
  2. 2Day 2 · Sum from 1 to n leaves out n
  3. 3Day 3 · Sorted name list comes back as None
  4. 4Day 4 · Price label crashes on a number
  5. 5Day 5 · Shout function returns lowercase text
  6. 6Day 6 · Word count says 3 for "hello world"
  7. 7Day 7 · Middle item lookup crashes with TypeError
  8. 8Day 8 · Settings lookup crashes on a missing key
  9. 9Day 9 · Average of 1 and 2 comes out as 1
  10. 10Day 10 · Checkout works without a valid payment
  11. 11Day 11 · Retry loop never stops on success
  12. 12Day 12 · Last even number crashes when there is none
  13. 13Day 13 · Adding a tag makes the whole list disappear
  14. 14Day 14 · Countdown never reaches zero
  15. 15Day 15 · Capitalizing a name crashes with TypeError
  16. 16Day 16 · Age next year crashes on form input
  17. 17Day 17 · Vowel counter skips capital letters
  18. 18Day 18 · Shopping total crashes at the end of the list
  19. 19Day 19 · Price parser rejects prices with cents
  20. 20Day 20 · AI Attempt: The palindrome checker
  21. 21Day 21 · AI Attempt: FizzBuzz never says FizzBuzz
  22. 22Day 22 · Range count skips the lowest valueMedium
  23. 23Day 23 · Adding up a dict's values crashesMedium
  24. 24Day 24 · Biggest gap between numbers comes out as -1Medium
  25. 25Day 25 · "All positive" check accepts a negative numberMedium
  26. 26Day 26 · Highest score picks "9" over "10"Medium
  27. 27Day 27 · Highest temperature reads 0 on a cold dayMedium
  28. 28Day 28 · Login says a registered user doesn't existMedium
  29. 29Day 29 · 2.5 rounds down to 2 instead of up to 3Medium
  30. 30Day 30 · AI Attempt: The Two Sum TrapMedium

How it works

Prefer JavaScript? 30 Days of Debugging: JavaScript