Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Python by (47.6k points)

I have read the official definition of "raise", but I still don't quite understand what it does.

In simplest terms, what is "raise"?

An example usage would help.

1 Answer

0 votes
by (106k points)

It is very simple you can use the below-mentioned code:-

if something: 

raise Exception('My error!')

To know more about this you can have a look at the following video tutorial:-

Browse Categories