Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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:-

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...