0
Can we have try without catch and which scenario?
Can we have try without catch and which scenario?
6 Respostas
+ 1
In any situatiin where you do not want a potential error to crash the program
+ 1
I used it here at the end to show that if you add more than five items, it raises an error. Though any other situation will work
https://code.sololearn.com/c97UM0bMcmqd/?ref=app
+ 1
In my code, adding an extra item would have thrown an error. Instead of crashing the program, I excecute a block of code in the except statement
Except runs code if there was an error instead of crashing the program
0
If condition not match then it execute try block,if not then it proceed to checkout.
0
What except does this here ?please explain
0
Ok thanks