i dont understand what raise does to an exception. please someone can explain? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

i dont understand what raise does to an exception. please someone can explain?

26th Aug 2016, 12:10 PM
alvarodr21
alvarodr21 - avatar
2 Answers
0
in your code you may want to control the variables' values or input etc. when you do that for a bad value with an if statement, you may want to raise an exception. that what does it mean: raising new exceptions.
26th Aug 2016, 12:58 PM
Oğuzhan Yılmaz
Oğuzhan Yılmaz - avatar
- 1
Exception try to catch errors in your code. When you perform your Python code only 2 cases will be at the end: your code successfully running or your code raise exception and exit. :)
27th Aug 2016, 9:04 AM
Viktor Sypko
Viktor Sypko - avatar