0
Can we use āraiseā statement outside the except block?
Yes / No? Why?
4 Answers
+ 3
You can, but you should try and catch your errors. The whole point of raise is when you don't want to allow certain input.
If there's a program that takes input, but it should only take letters, and numbers were entered, python sees nothing wrong with this. There can be a check to see if any numbers were entered and if so, raise an error to say so
+ 2
Yes you can use it outside the except block.
Why? That's the way the programming language was written š
It is a good explanation given by Slick . To disallow certain events (inputs) from happening.
Here's a quick example of its usage
Happy Coding š
https://code.sololearn.com/cc37rZ3tw8AN/?ref=app
+ 1
I get it now! š¤¦š¾āāļø
thank you Slick šš½
0
got it mate Tomiwa Joseph šš½