title: Loop until a specific user input is received in Python
body: <p>Hello Im doing a assessment for school. Im quite a newbie to python and I really have no idea on how to loop this</p>
  
  <pre><code>    achieved=50 #predefined variables for grade input
  
  merit=70
  
  excellence=85
  
  max=100
  import re #imports re an external modeule which defines re
  studentfname = input("Input Student first name in lowercase")
  if any( [ i&gt;'z' or i&lt;'a' for i in studentfname]):#checks if is in lowercase letters
      print ("Invalid input must be letter and in lowercase")
      import re
  studentlname = input("Input Student last name in lowercase")
  if any( [ i&gt;'z' or i&lt;'a' for i in studentlname]):
      print ("Invalid input must be letter and in lowercase")
      import sys
      raise SystemExit
      print(studentfname)
  elif len(studentlname)&gt;30:
      print ("Very long string") 
      raise SystemExit
      import re
  teacherfname = input("Input your first name in lowercase")
  if any( [ i&gt;'z' or i&lt;'a' for i in teacherfname]):
      print ("Invalid input must be letter and in lowercase")
      import sys
      raise SystemExit
      print(teacherfname)
  elif len(teacherfname)&gt;30:
      print ("Very long string") 
      raise SystemExit
      print(teacherfname)
  teacherlname = input("Input your last name in lowercase")
  if any( [ i&gt;'z' or i&lt;'a' for i in teacherlname]):
      print ("Invalid input must be letter and in lowercase")
      import sys
      raise SystemExit
      print(teacherlname)
  elif len(teacherlname)&gt;30:
      print ("Very long string") 
      raise SystemExit
      print(teachercode)
  teachercode = input("Input your teacher code in lowercase")
  if any( [ i&gt;'z' or i&lt;'a' for i in teachercode]):
      print ("Invalid input must be letter and in lowercase")
      import sys
      raise SystemExit
      print(teachercode)
  elif len(teachercode)&gt;30:
      print ("Very long string") 
      raise SystemExit
      print(teachercode)
  
  while True: #inputs student depending on the input prints out results id achieved, merit and excellence
   try:
      grade = int(input("Enter student's grade"))
  
      print(str(grade))
      break
   except ValueError: 
  
    continue
  #prints if not a number stops letters
  if grade &gt;merit&gt;excellence&gt;= achieved: 
   print("Achieved")
  if grade &lt; achieved:
      print("not achieved")
  if grade &gt;=merit&gt;excellence &lt; excellence:
      print("merit")
  if grade &gt;= excellence &gt; merit:
      print("excellence")
  if grade &lt; 0:
      print("can't be negative")
      raise SystemExit
  if grade &gt; max:
     print("Cannot be more than 100")
     raise SystemExit
  print("student's details")#last print of variablesa
  print(studentfname,studentlname)
  print("teacher's details")
  print(teacherfname,teacherlname,teachercode)
  print("student's grade")
  print(grade)
  if grade &gt;merit&gt;excellence&gt;= achieved: 
   print("Achieved")
  if grade &lt; achieved:
      print("not achieved")
  if grade &gt;=merit&gt;excellence &lt; excellence:
      print("merit")
  if grade &gt;= excellence &gt; merit:
      print("excellence")
  if grade &lt; 0:
      print("can't be negative")
      raise SystemExit
  if grade &gt; max:
     print("Cannot be more than 100")
     raise SystemExit
  print("Thanks for adding in the grades")
  
          break
  </code></pre>
  
  <p>Im trying to make it so that it will ask the user if they would like to input more student data after they have done one student. eg like if they wish to continue and basically repeat the coding again. I would really love some help</p>