Choose among: `builtins.quit`, `builtins.exit`, and `sys.exit`

I’m new to Python. It seems that they almost do the same thing (?)

May I ask, in what scenarios are these functions respectively applicable? Why would one use this one instead of the other two? TIA :slight_smile:

1 Like

Here is an article; I haven’t checked it:

The question would be much easier to answer if you provided a real comparison between these functions as seen in the article. Then you could ask why there are so many similar functions.

Use sys.exit if you really need too, but most of the time you don’t need to call any exit function… The other two are intended for use in the REPL, not in scripts or larger applications.