title: How python recursive function works in terms of addition?
body: <pre><code>def tri_recursion(k):
      if (k &gt; 0):
          result = k + tri_recursion(k - 1)
  
          print(result)
  
      else:
          result = 0
      return result
  
  print(&quot;\n\n Recursion Example results &quot;)
  
  tri_recursion(7)
  </code></pre>
  <p>The output is adding all numbers by itself till it's length = 7. But I don't know how the function is working.
  I mean if k = tri_recursion(7) (7-1 = 6).
  Then why first number in output is
  1, 3, 6, 10, 15, 21,</p>
  <p>I'm new to programming and this concept of recursive function is not at all clear.
  Can anyone explain me how this code is working?</p>