title: Tracking the number of recursive calls without using global variables in Python
body: <p>How to track the number of recursive calls without using global variables in Python. For example, how to modify the following function to keep track the number of calls?</p>
  
  <pre><code>def f(n):
      if n == 1:
          return 1
      else:
          return n * f(n-1)
  
  print f(5)
  </code></pre>