mercredi 21 décembre 2016

Python | Stopping/Restarting a script after user_input

Just before I ask the question I would like to say that I am very new to Python so what ever I ask might be simple to do.

My question is this: How do I stop the script after this question has been answered.

s1 = input("Is your phone freezing/stuttering? ")
if s1 == "Yes" or s1 == "yes":
    print("Try deleting some apps and this might help with your problem")
if s1 == "No" or s1 == "no":
    def foo():
        while True:
            return False

So what I exactly want here is when the user replies with 'Yes' I want the solution to come up and the script to stop or if possible even restart.

Aucun commentaire:

Enregistrer un commentaire