From the course: Python Practice: Real-World Coding Challenges
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Solution: The trouble with scribbles - Python Tutorial
From the course: Python Practice: Real-World Coding Challenges
Solution: The trouble with scribbles
(upbeat music) - [Instructor] In this challenge, you probably learned that programming isn't all just thrills and fun. We have a lot of different inputs here and a lot of different situations that need to be handled. Raising all of these exceptions for everything that could go wrong is tedious at times, yes, but I hope you'll find that it's absolutely worth it in the end when your code is robust, easy to use, and well-documented. So let's start off with the actual exception classes that I created. I made a TerminalScribeException. And then extending that, I have the InvalidParameter exception. And most of the exceptions that I throw here are going to be InvalidParameter exceptions because there are lots of ways that you can get the parameters wrong. And for fun, I made the error messages red using the term color package. And I find that really just kind of helps them pop. The one place I threw a TerminalScribeException…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.