To end a Python program, press one of the following key combos depending on your system:
CTRL + Con Windows.
Control + Con Mac.
How to End the Interactive Python Command-Line Session
To leave the interactive Python command-line session, press:
CTRL + Zon Windows.
Control + Zon Mac.
Or run the
exit() function in your session:
How to Terminate a Python Script
If you need to end a Python program from the code, use the
Before you do that make sure to import the
import sys sys.exit()
Thanks for reading. I hope you got your program to stop 🙂