Where exactly we need to use "raise" clause and why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Where exactly we need to use "raise" clause and why?

I didn't get the objectivity of "raise" clause here at SoloLearn. It's like re-raising exceptions where as natural tendency we usually need to catch/except exceptions. Any clue to grab the concept of raise clause in real life programming problems? Your response(s) would be really appreciated.

31st Jul 2017, 7:45 AM
Najabat Ali Khan
Najabat Ali Khan - avatar
1 Answer
+ 5
It would be useful to raise exception in your code, when you write modules that will be used by other people, or to better handling big codes ^^ https://softwareengineering.stackexchange.com/questions/332017/why-raise-an-exception-if-JUMP_LINK__&&__python__&&__JUMP_LINK-raises-it-for-me https://jeffknupp.com/blog/2013/02/06/write-cleaner-python-use-exceptions/
31st Jul 2017, 7:49 AM
visph
visph - avatar