Debugging Our Code
Let’s talk about one of my favorite activities: catching bugs.

Unfortunately, I don’t really mean catching physical bugs, but debugging our code. Bugs are mistakes in our code, and debugging means finding and solving them. Sometimes, they’re obvious to catch. Other times, they can bug you for days. Having a structured approach to debugging helps. That’s what this chapter is for. I’m going to show you several methods that we can use to find bugs in our code. There are different approaches, and often we don’t need all of them. However, especially if you’re stuck for longer, it can be nice to try different things to find the problem.
Throughout this chapter, we’ll be using an example project: a pet shelter management system. It’s a small program with functions for adding pets, feeding them, and checking whether they’re eligible for adoption. Cats and dogs alike, everyone’s welcome...