title: My program does not stop when i tell it to exit
body: <p>When i press 5 for quit it comes up as an error but does not work</p>
  
  <p>For some reason </p>
  
  <pre><code>import sys
  sys.exit()
  </code></pre>
  
  <p>does not work</p>
  
  <pre><code>def ask (user) :
  
      if user == 1:
          user = input('select a file with an ASCII art image ')
          f = open(user, 'r')
          if f.mode == 'r':
              showart = f.read()
              print(showart)
              print("You will be returned to the menu")
  
      elif user == 2:
          print('hi')
  
      elif user == 3:
                print ('hi')
  
      elif user == 4:
              print("hi")
  
      elif user == 5:
              print('goodbye')
              import sys
              sys.exit()
  
  
  while (True) :
      print("1 - Display ASCII art ")
      print("4 - convert RLE option ")
      print("5 - Quit ")
      print("   ")
      print("   ")
      print("   ")
  
      try:
          user=int(input("Select an integer between 1 and 5 : "))
  
          if (user&lt;5 and user &gt; 1) :
              ask(user)
          else:
                  user=int(input("Please enter a number between 1 and 5 : "))
                  while (user &gt; 5 or user &lt; 1) :
                      user=int(input("Please enter a number between 1 and 5 : "))
  
                  ask (user)
      except:
          print('***SORRY, YOUR OPTION DID NOT WORK***\n ***PLEASE SELECT ANOTHER NUMBER***')
  </code></pre>
  
  <p>it prints goodbye but it does not quit the program</p>