+ 3
Is there any option in python to exit the code, like the exit function in C/C ++
3 Antworten
+ 8
The exit() function of the sys module is what you're looking for.
```
import sys
sys.exit(1)
```
The above lines exit the program with exit status 1
+ 1
there is actually.
in the python terminal, type exit() or hit ctrl-d.
+ 1
yes, just:
exit()
or:
ctrl + c