Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Promoted
How do I restart a program based on user input? (Python)?
Hi, I wrote a program and at the end I want the user to be able to input yes or no after it asks whether they want the program to restart. How can i achieve this?
1 Answer
Relevance
- 5 years ago
Whatever your code is, rather than simply writing it as a program, write it as a function. That way, when the user inputs 'yes', you can run the function from within itself, and raise.SystemExit() if the user doesn't want to.
Still have questions? Get your answers by asking now.