0
exception
which error will be occured during the execution of this code : try: print(1 / 0) except ZeroDivisionError: raise ValueError Here they said : 'ZeroDivisionError and ValueError But when i tried it the error that occured is ; "Syntaxe Error"
4 Respuestas
+ 2
It works just fine. Try double checking your spellings and indentations.
+ 1
Am getting ZeroDivisionError and ValueError as expected. Check again..
Tag the language also.. As python.
0
oualid hajane I think if you are writing the same code you posted here you definitely will get a synthax error, try to see onpine a template for the try and catch
0
Hey oualid hajane I assume you are using java and here is a template. try { // Block of code to try } catch(Exception e) { // Block of code to handle errors }