User Defined Exceptions in Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

User Defined Exceptions in Python

I have seen on internet of User Defined Exception like this: https://code.sololearn.com/cOft6Tuk3J62 Is there any way to have a print statement when we are defining the exceptions only so that we don't have to later include everytime the statement in "except". (If I include a print statement while declaring the exception class it will always be printed at top)

14th Jun 2019, 3:42 PM
harshit
harshit - avatar
0 Answers