title: Tracing recursive function in paper
body: <p>I am learning recursion nowadays and as the saying goes, the best way to get proficient in recursion is to practice as much as possible. I have a habit of tracing the program in paper (I guess all of us had at some point).</p>
  
  <p>For example, If I had a function like printing a number from 1 to 10:</p>
  
  <pre><code>def print_n():
      for i in range(1,11):
          print i
  </code></pre>
  
  <p>I would trace like:</p>
  
  <pre><code>i
  .......
  1
  2
  3
  4
  ... and so on
  </code></pre>
  
  <p>But when I am practicing with recursion, I am finding hard time tracing the program in paper. Can somebody recommend with example a best way to trace recursive function in paper?
  You can use the following Fibonacci (again!!!) to illustrate your example or you might surprise the readership.</p>
  
  <pre><code>#RECURSIVE FUNCTION TO RETURN Nth FIBONACCI NUMBER
  def fib(n):
      if n is 0 or n is 1:
          return 1
      else:
          return fib(n-1) + fib(n-2)
  </code></pre>