try: # raise a custom exception raise Exception("A custom exception") except Exception as err: print(err) finally: print('This execute no matter if an exception occurs or not')