os to stop a program python code example
Example 1: exit python script
import sys
sys.exit()
Example 2: how to stop running code in python
#to stop all execution of code
exit()
import sys
sys.exit()
#to stop all execution of code
exit()