What is the use of raise statement? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is the use of raise statement?

Print(1) raise ValueError Print(2) By using "raise" Statement "print(2)" is not execute . I think there's an exception occurred due to "raise"statement. Am I correct?

24th May 2019, 1:32 AM
Hari Krishna Sahu
Hari Krishna Sahu - avatar
1 Answer
+ 5
Yes I believe it's equivalent to throwing an exception.
24th May 2019, 1:47 AM
Sonic
Sonic - avatar