title: To ensure an action happens only once during a recursive call
body: <p>I have a procedure which contains a step which involves calling the procedure recursively. I want a certain action to be not done the first time but done the other times it is called recursively.</p>
  
  <pre><code>def a(string):
      while string.startswith('/'):
          string =string[1:]
      stringa = string.split('/',1)
  
      if(len(stringa)&gt;1):
          a(stringa)
  </code></pre>
  
  <p>Basically my string is of type <code>/a/b/c/d</code>. I want to have stringa as <code>{/}{a/b/c/d}</code> during the first time and the successive recursion as 
                      <br>stringa ={a}{b/c/d}
                      <br>stringa ={b}{c/d} 
                      <br>stringa ={c}{d}  </p>