title: Memoization Usage/Cache Storing
body: <p>I am writing a program that calculates the Pascal Identity of two variables, hard coded into the program, as I am new into Python and trying out caching and memoization. Here is what I have so far: </p>
  
  <pre><code>counter = 0
  
  call_cacheK = {}
     def callTest(n, k):
     global counter
  
     if n in call_cacheK:
         return call_cacheK[n]  
     if k == 0:
         return 1
     elif k == n:
         return 1 
     elif (1 &lt;= k) and (k &lt;= (n-1)):
         counter += 1
         #call_cacheK[n] = result
         result = ((callTest(n-1, k) + callTest(n-1, k-1)))
     print(result)
     return result
  
  callTest(20, 11)
  #167,960
  </code></pre>
  
  <p>My function will output the final real answer with what it has now, but with a lot of outputted answers. I cannot seem to get how to properly store the values to be used in the cache.</p>
  
  <p>How do I properly use <code>call_cacheK</code> to store the <code>result</code> values I have already used?</p>
  
  <p>Thank you.</p>