How do I handle errors without my program crashing?

Asked by kemiadewale · 6 months ago

1 Answer

59
amorebise · 6 months ago Top Answer

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.