Page 1 of 1

Python program Follow these steps: ● In a file called sum_recursion, create: o a function that takes a list of integers

Posted: Thu Jul 14, 2022 2:17 pm
by answerhappygod
Python program Follow these steps: ● In a file calledsum_recursion, create: o a function that takes a list of integersand an integer as 2 arguments. The integer will represent an indexpoint. o This function needs to add the sum of all the numbers inthe list up until and including the given index point by making useof recursion and no loops. Examples of input and output:adding_up_to([1, 4, 5, 3, 12, 16], 4) => 25 => adding thenumber all the way up to index 4 (1 + 4 + 5 + 3 + 12)adding_up_to([4, 3, 1, 5], 1) => 7 => adding the number allthe way up to index 1 (4 + 3).
(May you kindly include comments as much as you can) Thankyou.