Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tri_recursion(k):
- if(k>0):
- result = k+tri_recursion(k-1)
- print(result)
- else:
- result = 0
- return result
- print("nnRecursion Example Results")
- tri_recursion(6)
- Recursion Example Results
- 1
- 3
- 6
- 10
- 15
- 21
Add Comment
Please, Sign In to add comment