+ 1
why would you ever want to raise an exception?
3 Respostas
+ 6
It's usefulness is realised when creating exceptions of your own. If you make a function or a class, you may want to raise a custom exception if something goes wrong so it will notify the user what happened, where it went wrong etc. It is especially useful when you are going to distribute the code so that when other developers use, they know what went wrong and how to handle it.
+ 1
every case has an exception that you don't want to get disturbed by,that's why it is created as class function in python. with the help of this function you can even create your own exceptions ...it is a way to understand what kind of mistake you have made that caused problem..
+ 1
To give you an idea about what is wrong with your code!