Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions