title: How do I repeat this start() function and get it to not break in the middle of a loop?
body: <p>I've been trying to get this code to repeat the start function and it just keeps stopping before my &quot;gohome()&quot; function and the of my &quot;gomine()&quot; function... Maybe you guys can see something I'm not seeing?
  Also, I'm using Python 2 in this weird IDE.</p>
  <pre class="lang-py prettyprint-override"><code>def takeoff():
   robot2.takeOff(5)
   robot2.moveForward(23)
   robot2.setAltitude(2)
   
  def gomine(i):
   print len(vrad_comms.getMines())
   while len(vrad_comms.getMines()) &lt;= i:
       i+=1
   targetMine = vrad_comms.getMines()[i];
   k=0
   while k&lt;3:
       k+=1
       angle = float(robot2.getAngleTo(targetMine[0], targetMine[1]))
       if (angle &lt; 0.0):
           robot2.turnLeft(abs(angle))
       else: 
           robot2.turnRight(angle)
       dist = robot2.getDistanceTo(targetMine[0], targetMine[1])
       robot2.moveForward(dist)
       robot2.setAltitude(0)
       robot2.mine()
  
  def gohome():
   print &quot;go home&quot;
   robot2.takeOff(7.0)
   m=0
   while m&lt;2:
       m+=1
       angle=float(robot2.getAngleTo(home[0],home[2]))
       if (angle &lt; 0.0):
           robot2.turnLeft(abs(angle))
       else:
           robot2.turnRight(angle)
       angle = float(robot2.getAngleTo(home[0], home[2]))
       dist = robot2.getDistanceTo(home[0], home[2])
       robot2.moveForward(dist)
       error = robot2.getDistanceTo(home[0], home[2])
       robot2.turnRight(180)
       robot2.land()
       robot2.deposit()
       print &quot;Deposited&quot;
       
  def start():
   takeoff()
   gomine(i)
   gohome()
   
  t=0
  if t&lt;5:
   t+=1
   start()
   print &quot;Robot 2 is on their way again&quot;
  </code></pre>