Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

what is the point of "except" keyword if you already have a "raise" keyword inside your function ..what is the point?

what is the point of "except" keyword if you already have a "raise" keyword inside your function ..what is the point?, pls don't give a complexed robotic response, pls respond in laymen terms from a beginners mindset point of view, lol basically speak english to where I understand because I am so confused

1 Answer

raise creates the error. except deals with the error. (In JavaScript the they're called throw and catch.)

raise is sort of saying "There's a problem, we can't continue in the code as normal".

except is saying "Okay, I have a plan for how to deal with this kind of problem"

If you didn't have an except block, the error could completely derail your app.

i understand the concept way much better now, why couldn't they just say that lol

np