title: How loop an input over until correct answer is entered
body: <p>I am finding it difficult to loop my raw_input over and over again until the right answer is entered (Im a noob) </p>
  
  <p>here is the question:</p>
  
  <p>write a Python program that takes in a user input as a String. While the String is not “John”, add every string entered to a list until “John” is entered. Then print out the list.</p>
  
  <p>Example program run (what should show up in the python console when you run it):</p>
  
  <pre><code>Enter your name : &lt;user enters Tim&gt;
  Enter your name : &lt;user enters Mark&gt;
  Enter your name: &lt;user enters John&gt;
  Incorrect names: [‘Tim’, ‘Mark’]
  </code></pre>
  
  <p>and this is my code:</p>
  
  <pre><code>answer = "John"
  
  nameString = ['']
  
  nameInput = raw_input("Enter a name")
  
  if nameInput in answer:
  
      print nameString
  
  else:
  
      nameString.append(nameInput)
  </code></pre>
  
  <p>I'm not entirely sure what code should be written to achieve this loop. </p>