title: I'm trying to loop my code so that if input is invalid it'll keep looping
body: <p>Is there a way to loop this code so that it keep asking for the correct input. I'm new to python and getting this far was a miracle</p>
  
  <p>Kind regards
  Harrry</p>
  
  <pre><code>   import re
  
  r = re.compile(r'[a -z A -Z]')
  print("Welcome to this questionnaire:")
  x = input("Your Name:")
  
  while not r.match(x):
      print("Come on,'", x, "' can't be your name")
      x = input("Your Name:")
  
  if 3 &lt;= len(x) &lt;= 10:
      print("Hi,", x, "!")
  elif len(x) &gt; 10:
      print("Mmm,Your name is too long!")
  elif len(x) &lt; 3:
      print("Sorry, your name is too short!")
  </code></pre>