How to Handle Exceptions in Python