Exception handlers handle Exceptions occur inside functions.
def this_fails(): x = 1/0 try: this_fails() except ZeroDivisionError, detail: print 'Handling run-time error:', detail
1. | Simple exception handling example | ||
2. | Catch exception in a function | ||
3. | Handling Exceptions | ||
4. | handle multiple exceptions | ||
5. | Demonstrates handling exceptions |