Question: please use the python to solve the question Cell 4: Make a function called cumuluative_sum() that uses a loop to print the cumulative sum of

 please use the python to solve the question Cell 4: Make

please use the python to solve the question

Cell 4: Make a function called cumuluative_sum() that uses a loop to print the "cumulative sum" of a list: first the first number, then the sum of the first and second numbers, then the sum of the first, second, and third numbers, etc. It should work with a list of any length. Add code so that before each of these values, it prints the number of values you've printed so far (followed by a colon and a space). Use the enumerate() function to get this index. For example, calling cumulative sum([3,4,5]), should print: 1:3 2:7 3:12 It should also return the cumulative sum (in the example above, (3,7,12]). After you declare the function, use it to print the cumulative sum of all the y values (distances walked) from cell 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres how you can implement the cumulativesum function in Python python def cumulativesumnumbers Ini... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!