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 Darsh K Aug 8, 2023 1.7K views 1 answer
Share

About this question

I have been using Python 3.2 and attempting to exit it after the user inputs that they do not wish to continue. Is there code that may exit in an if statement in a while loop? I have tried utilizing exit(), sys.exit(), sys.quit(), quit(), and raise System Exit

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.