0 votes
1 view
in Python by (47.8k 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 (107k 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:-

Welcome to Intellipaat Community. Get your technical queries answered by top developers !

Categories

...