function to check any termination or error in my program python code example Example: exit python script import sys sys.exit()