If you want to exit your code programmatically, you might think to use the functions
quit(), however this is bad practice. These functions are constants added by the
site module as a convenient method for exiting the interactive interpreter shell, and should not be used in programs.
You should use either
There's not much practical difference between these two other than having to
import sys for the latter. Both take an optional argument to provide an exit status.
Official documentation with the warning not to use
quit() in source code.