Question: 5 points Status: Not Submitted Using a for loop, ask the user for numbers until they enter 0 (So if you don't know how many
5 points Status: Not Submitted Using a for loop, ask the user for numbers until they enter 0 (So if you don't know how many numbers this is, which loop should you use, while or for ?). Store those numbers in a list. Each time you add a new number to your list, print the list and add it to a sum. (Your list will initially be empty: nameofList = []) You should report the sum of the numbers in the list at the end and the average (use the length of the list to help you out here. DO NOT create a variable for counting. Also, note how the average could have a decimal). An example run of your program might look like this: Enter a number ( to quit): 3 [3] Enter a number: 6 [3, 6] Enter a number: 12 [3, 6, 12) Enter a number: 2 [3, 6, 12, 2] Enter a number: -5 [3, 6, 12, 2,-5) Enter a number: 0 Sum: 18 Average: 3,6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
