Question: Finish the program below by adding code to do the following: 1. Show each element (number) in the list 'sp' on a separate line

Finish the program below by adding code to do the following: 1.

 

Finish the program below by adding code to do the following: 1. Show each element (number) in the list 'sp' on a separate line (one value per line). 2. Show as output each element (number) in the list 'sp' that is even. 3. Show a sentence identifying the average of all the numbers in the list 'sp' that are less than 25. In other words, do not include the larger numbers in the average. (For example, if the list contained: [ 54, 7, 75, 2] - Part 1 would write all 4 numbers with each number on a separate line; - Part 2 would write 54, 2; - Part 3 would write a sentence showing 'average = 4.5! Your program must work with whatever numbers the user enters. sp=[] num=int (input ('Enter a number (0 to finish): ')) while num!=0: Write a code sp.append (num) num=int (input ('Enter another number (0 to finish) :')) print () Hint. In Python indentations are very important. Switch to the HTML Editor mode for saving all indentations and use a tag before a code and after the code. Example of the output Enter a number (0 to finish): 10 Enter another number (0 to finish):15. Enter another number (0 to finish):20 Enter another number (0 to finish):25 Enter another number (0 to finish):30 Enter another number (0 to finish): 0 10 15 20 25 30 The even numbers: 10 20 30 The average of numbers

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 Algorithms Questions!