Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

how to exit a python script in an if statement

Asked by Naina Pandey Jul 27, 2021 1.3K views 1 answer
Share

About this question

 I'm using Python 3.2 and trying to exit it after the user inputs that they don't want to continue, is there code that will exit it in an if statement inside a while loop? I've already tried using exit(), sys.exit(), sys.quit(), quit(), and raise SystemExit. How python close program?

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.