From the course: Programming Concepts for Python
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Validate input - Python Tutorial
From the course: Programming Concepts for Python
Validate input
- Time to finish cleaning up the house. I like to put on a little music when I clean. And Olivia, there's a few more dishes in the dishwasher. Do you mind starting that? - Sure. - Thanks, I'll just stay in here and vacuum up the living room. (vacuum rumbling) Looks like we ran into another error. Unfortunately, I have no idea what caused this or why this problem occurred. Just knowing that something's wrong doesn't help me to figure out what I need to do to fix it. When an error occurs, the source of that error should raise an exception and pass along information about the problem so the program can do something to handle the error. - The power went as soon as I turned on the dishwasher. I think we tripped the circuit. - Ah, thanks. Now that I know an error has occurred and the reason for the problem, I can do something to handle it. - [Olivia] To demonstrate that scenario, we'll use the circuit breaker class,…