I've started python in a DOS window. it displays "Python 3.12.0".... But if I input "quit()", I got the message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'quit' is not defined
Now I cannot quit python. Why?
In Python, you can exit the interpreter by typing either
exit()or pressing Ctrl + Z followed by Enter (on Windows).Try using
exit()instead ofquit()to exit the Python interpreter in the DOS window.you can use
exit(0)to exit the Python interpreter as well.