Until now, you've used the mighty print() function to inspect the state of your code at specific points and used it to figure out what's going on. Printing variables gives you insight into what your variables are like at any stage of the execution of your script. Using print() is a straightforward and powerful ally when debugging your code.
More Code, More Problems
However, once you start dealing with larger applications, you'll sooner or later hit the ceiling of possibilities with print(). You might have already been there while learning about APIs and databases in the previous section.
And this is completely normal! The more code you write, and the more complex it gets, the more errors ("bugs") will find their way in there.
Because debugging is such a common task in software development, whole libraries are built just to make it easier and more effective.
Why Use the Debugger
Complex programs are likely to have multiple software bugs in them. In this section of your course, you'll take a look at tools that can help debug your Python programs.
And even if bugs may be annoying sometimes, don't be mean to them! They are often pretty cute, and there's a lot you can learn from them:
Photo by Charlotte Descamps https://unsplash.com/@descampscha
In an upcoming lesson, you'll read about breakpoint(), which allows you to quickly add check-in points to your code that you can use to inspect your script.