title: Loop a function using the previous output as input
body: <p>When my function foo generating a new element, I want to reuse the output and put it in foo n-times. How can I do it?</p>
  <p>My function:</p>
  <pre><code>def foo(x):
      return x + 3
  
  
  print(foo(1))
  &gt;&gt;&gt;4
  </code></pre>
  <p>For now. I'm using this method:</p>
  <pre><code>print(foo(foo(foo(1))))
  </code></pre>