mercredi 22 février 2017

Python | IF statment stop script after user input has been made

I am currently working on a automated troubleshooter using Python. Below is a piece of my script which I need help with.

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 want to happen is my script to stop when the user types in YES and when the solution to the fix comes up. Is there a possible loop for that or something similar? Also if the user types in NO then I want the script to continue to the next question.

Aucun commentaire:

Enregistrer un commentaire