Can anyone explain, what does this mean:"Unlinke other exception if assertion is not handled, then program is terminated? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone explain, what does this mean:"Unlinke other exception if assertion is not handled, then program is terminated?

4th Jan 2017, 8:20 AM
Pritish Porwal
Pritish Porwal - avatar
2 Answers
+ 7
If "assertion" throws an error and is not handled by "try-catch" blocks, the program terminates/ends.
4th Jan 2017, 8:41 AM
Valen.H. ~
Valen.H. ~ - avatar
0
Actually it is true of any exception (except maybe StopIteration in for loops and GeneratorExit) but an assertion guarantees that your program is used in the conditions you wanted (or didn't assert for)
5th Jan 2017, 7:06 PM
Amaras A
Amaras A - avatar