title: Halt a recursively called function
body: <p>I'm trying to halt the for loop below once values <code>(x,y)</code> or <code>(z,2)</code> have been returned so that the value <code>i</code> doesn't keep increasing, and simply halts when the <code>if</code> or <code>elif</code> condition is first </p>
  
  <pre><code>def maxPalindrome(theList):
      # students need to put some logic here
      maxcomplist = theList[:]
      maxcomplist.reverse()
      control = len(theList) - 1
      # exit if maxPalindrome is True
      for i in range(control):
          if maxcomplist[:] == theList[:]:
              x = 0
              y = len(theList)
              return (x, y)
              break
          elif maxcomplist[i:control] == theList[i:control]:
              successList = theList[i:control]
              z = i
              w = len(theList) - z - 1
              return (z, w)
  </code></pre>
  
  <p>How can I accomplish this?</p>