try except python print message code example Example 1: throwing an exception python raise Exception("message") Example 2: try pass python except: pass