59
We use try and except. It’s like a safety net. "Try to divide these numbers, except if the second number is zero, show a friendly message instead of crashing."
This is vital for building apps that real people use. You can't control what a user types, but you can control how your program reacts to their mistakes.
Log in to add a comment.