title: How to repeat function in Python depending on output?
body: <p>Recently I've got a small problem with if else statement. Namely I want to create a function that asks user for input whether he wants to read the file that script has created or not, so if the input is correct function does its thing however when input is incorrect I want it to revert to question again.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>def read_the_file(output):
      print """
  Do you want me to read your newly created file?
  Type [Y]es or [N]o
      """
      question = raw_input("&gt; ")
      reading = output.read()
      if question == 'yes'or question == 'Y' or question == 'y':
          print "BEGINNING OF FILE\n\n" + reading + "\n END OF FILE"
      elif question == 'no' or question == 'N' or question == 'n':
          sys.exit[1]
      else :
          print "wrong input"
  
  read_the_file(output_file)
  </code></pre>
  
  <p>so what I'd like the function to do is instead write</p>
  
  <pre><code>else:
      print "wrong input"
  </code></pre>
  
  <p>is to go back and repeat itself.</p>