How to handle python exception inside if statement?
I have the following code with an exception inside if statement
a,b =5, 0
try:
if b != 0:
print a/b
else:
raise ZeroDivisionError
except Exception as e:
print e
I am not able to catch the exception. How to catch the exception?