Question: How would I understand how to format this? Create a list called numbers that contains the following values: 1, 5, 3, 0, 8, 2, -3,

How would I understand how to format this?

Create a list called numbers that contains the following values:

1, 5, 3, 0, 8, 2, -3, 8, 0, 10, 0, 5, 2, 0, 6, 2, 0

Your program will loop through the list and add the current number to a running total.

When it encounters a zero number in the list, it will put the current total into another list called answers, and then reset the running total back to zero.

When it finishes the list of numbers, the program will print out the answers in numerical order from highest to lowest.

The output should not display the brackets from the list

Dont Repeat Yourself!

The correct code for this lab will only have one line of code that does any adding.

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!