Try, except how to use?

i don’t understand this concept, in editor you use ‘raise’ but didn’t explain, and the example is not enough for me to get it.
what is this used for in real life, what kind of input will get what result. have nothing.

1 Like

Hey @haodo9x2317615806!

I’m not exactly sure what your question is… are you asking what the application of this would be in real life?

I would say that the point of this is to catch specific bugs and by having an error statement like that, you know exactly what the problem is.

Also, all that raise ValueError does is raise a valueerror. I don’t think it needs to be explained because:

  • It’s kinda self explanatory
  • its not the point of the exercise.
    The point of the exercise was to learn how to leave specific error messages when you attempt to call different functions.

Hope this helps!

here, this picture, until i go to this quiz , i understand what it is used for, you really need to rewrite this part like this. this is real example.



You’re right, this lesson isn’t explained very well. I would recommend submitting a bug report, and labeling it “Improvement” so then the people who actually have the power to change this can fix this issue.

i thought you had more than that power lmao.

1 Like

Nope! No one on the forums will be able to change the actual exercises, which is why I recommend sending a bug report

1 Like