def foo(x):
assert x
return 1/x
try:
print(foo(0))
except ZeroDivisionError:
print(“zero”)
except:
print(“some”)
I dont understand why the output is ‘some’ and not ‘zero’
def foo(x):
assert x
return 1/x
try:
print(foo(0))
except ZeroDivisionError:
print(“zero”)
except:
print(“some”)
I dont understand why the output is ‘some’ and not ‘zero’