递归

  1. def tri_recursion(k):
  2. if(k>0):
  3. result = k+tri_recursion(k-1)
  4. print(result)
  5. else:
  6. result = 0
  7. return result
  8.  
  9. print("\n\nRecursion Example Results")
  10. tri_recursion(6)