Guest User

Untitled

a guest
Oct 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  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("nnRecursion Example Results")
  10. tri_recursion(6)
  11.  
  12. Recursion Example Results
  13. 1
  14. 3
  15. 6
  16. 10
  17. 15
  18. 21
Add Comment
Please, Sign In to add comment