Cognizant interview question

Program for exception handling using function in python