Exception finally return
def div(a, b):
try:
print("try")
c = a / b
except Exception:
print("exception")
return
finally:
print("finally")
div(2, 1)
print('---')
div(2, 0)
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
def div(a, b):
try:
print("try")
c = a / b
except Exception:
print("exception")
return
finally:
print("finally")
div(2, 1)
print('---')
div(2, 0)