Computer Science, asked by KaranKing148, 10 months ago

How do you properly ignore Exceptions in Python?

Answers

Answered by Anonymous
0

How do you properly ignore Exceptions in Python?

PythonServer Side ProgrammingProgramming

I have a try-except block in following code and I just want to continue with the code by ignoring the exception block.

try:

x,y =7,0

z = x/y

except:

#do nothing

The problem is if I leave the ‘except’ block empty or with a #do nothing, it gives an error as follows

File "C:/Users/~foo.py, line 7

IndentationError: expected an indented

Similar questions