Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started