What function should I use to fix my code?
<p>I'm an amateur trying to code a simple troubleshooter in Python but I'm sure what function I need to use to stop this from happening... 
<a href="http://i.stack.imgur.com/XJsB1.png" rel="nofollow">enter image description here</a></p>

<p>What should I do so the code doesnt continue running if the user inputs yes?</p>

<pre><code>  TxtFile =open('Answers.txt')
lines=TxtFile.readlines()
import random
def askUser(question):
    answer = input(question + "?  ").lower()
    Split = answer.split()
    if any(word in Split for word in KW1):
        return False
    elif any(word in Split for word in KW2):
        return True
    else:
        print("Please answer yes or no.")
        askUser(question)

KW1=["didn't", "no",'nope','na'] #NO
KW2=["did","yes","yeah","ya","oui","si"] #YES
print (lines[0])

print("Nice to meet you, " + input("What is your name? "))
print("Welcome to my troubleshooter")
#This is the menu to make the user experience better
shooter=True
while shooter:
   print('\n\n1.Enter troubleshooter\n2.Exit\n\n')
   shooter=input('Press enter to continue: ')
   if shooter==('2'):
       print('Ok bye') 
       break



words = ('tablet', 'phone', 's7 edge')
while True:
    question = input('What type of device do you have?: ').lower()
    if any(word in question for word in words):
            print("Ok, we can help you")
            break                
    else:
            print("Either we dont support your device or your answer is too vague")

if askUser("Have you tried charging your phone"):
    print("It needs to personally examined by Apple")
else:
    if askUser("Is it unresponsive"):
        print (lines[0])         
    else:
        print ("Ok")
    if askUser("Are you using IOS 5.1 or lower"):
        print (lines[1])
    else:
        if askUser("Have you tried a hard reboot"):
            print (lines[2]) 
        else:
             if askUser("Is your device jailbroken"):
                 print (lines[3])
             else:
                  if askUser("Do you have a iPhone 5 or later"):
                      print (lines[4])
                  else:
                      print(lines[5])
             print ('Here is your case number, we have stored this on our system')         
             print (random.random())
</code></pre>

<p>Here is my code for reference.</p>

<p>Edit: Here is the problem
<a href="http://i.stack.imgur.com/XJsB1.png" rel="nofollow">enter image description here</a></p>

<p>It should just end the code there but it doesnt. I'm not sure how I can fix it</p>

<p>I would recommend moving the following:</p>

<pre><code>   if askUser("Are you using IOS 5.1 or lower"):
        print (lines[1])
    else:
        if askUser("Have you tried a hard reboot"):
            print (lines[2]) 
        else:
            if askUser("Is your device jailbroken"):
                print (lines[3])
            else:
                if askUser("Do you have a iPhone 5 or later"):
                  print (lines[4])
              else:
                  print(lines[5])
              print ('Here is your case number, we have stored this on our system')         
              print (random.random())
</code></pre>

<p>into the else part of:</p>

<pre><code>if askUser("Is it unresponsive"):
</code></pre>

<p>Hope this helps.</p>

python