Last active
September 2, 2015 18:23
-
-
Save M-Barnett/bfaf20c2d7f9ef380423 to your computer and use it in GitHub Desktop.
Recursive Summation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def summation_recursion(submit_list, output = 0): | |
given_list = submit_list | |
if len(given_list) > 0: | |
output += given_list.pop() | |
summation_recursion(given_list, output) | |
else: | |
return output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment