title: How do I get my program to loop back and restart in Python?
body: <p>I understand this question has been asked before but I cant find a working solution. I'm new to Python and need to create a BMI calculator that will allow the user to enter multiple BMI's, but I can't get it to loop back to the beginning sucessfully. I've tried 2 ways and neither work.</p>
  
  <p>Here's what I have for the first one, but this one wont run as "continue not in loop":
  `</p>
  
  <pre><code>while True:
      print("BMI Calculator")
  
  weight = float(input("\nPlease enter your weight in KG: "))
  height = float(input("\nPlease enter your height in metres: "))
  bmi = weight/(height*height)
  
  if bmi &lt;= 18.5:
      print("Your BMI is", bmi,"which means you are underweight.")
  
  elif bmi &gt; 18.5 and bmi &lt; 25:
      print("Your BMI is: ", bmi, "which means you are normal")
  
  elif bmi &gt; 25 and bmi &lt; 30:
      print("Your BMI is: ", bmi, "which means you are overweight")
  
  elif bmi &gt; 30:
      print("Your BMI is: ", bmi, "which means you are obese")
  
  else:
      print("There was an error with your input, Sorry.")
  
  while True:
      answer = input("Would you like to enter another? key y/n: ")
      if answer in ("y", "n"):
          break
      print("Invalid Input")
  if answer == "y":
      continue
  else:
      input("\nPress the enter key to exit")
      break
  </code></pre>
  
  <p>`</p>
  
  <p>The other one I have is this, but it prints BMI Calculator and then stops:
  `    </p>
  
  <pre><code>def start():
      print("\nBMI Calculator")
  
  weight = float(input("\nPlease enter your weight in KG: "))
  height = float(input("\nPlease enter your height in metres: "))
  bmi = weight/(height*height)
  
  if bmi &lt;= 18.5:
              print("Your BMI is", bmi,"which means you are underweight.")
  
  elif bmi &gt; 18.5 and bmi &lt; 25:
              print("Your BMI is: ", bmi, "which means you are normal")
  
  elif bmi &gt; 25 and bmi &lt; 30:
              print("Your BMI is: ", bmi, "which means you are overweight")
  
  elif bmi &gt; 30:
              print("Your BMI is: ", bmi, "which means you are obese")
  
  else:
              print("There was an error with your input, Sorry.")
  
  answer = input("Would you like to enter another? key y/n: ")
  while answer == "y":
          start()
          answer = None
  
  if answer == "n":
      input("\nPress the enter key to exit")
  </code></pre>
  
  <p>`</p>