R
R
Reality2018-07-09 23:55:59
Python
Reality, 2018-07-09 23:55:59

Which option is better to use to exit the script and why?

raise SystemExit
assert False
sys.exit()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2018-07-10
Tester @Aoom

https://docs.python.org/2/library/exceptions.html#...

exception SystemExit
This exception is raised by the sys.exit() function.

assert is not made for this at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question