Finish the program below by adding code to do the following: 1. Show each element (number)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 <25 is 15.00 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 <25 is 15.00
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these algorithms questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Where is the line in the sand the point where such behaviors are so destructive that you feel that the relationship needs to end?
-
Julian was considering whole life and term insurance for his 20-year need. Which one should he select?
-
Bangles Corporation issued 5 -year, 11% bonds with a face value of $300,000 on April 1 for $288,000. Interest is paid semiannually' at October 1 and April 1. Prepare the journal entries to record the...
-
An experiment is conducted in which the weight losses of people who try a new Fast Diet Supplement are compared to the weight losses of a control group of people who try to lose weight in other ways....
-
Langley, Inc. is the manufacturer of lawn care equipment. The company incurs the following costs while manufacturing edgers: Handle and shaft of edger Motor of edger Factory labor for workers...
-
" 1 . Thunder Creek Company prepares its Manufacturing Overhead Budget. For each direct labor hour, the variable overhead costs are: Indirect Materials = $ 1 . 0 0 per DLH; Indirect Labor Cost = $ 1...
-
The Ploughman family owns and operates a 640-acre farm that has been in the family for several generations. The Ploughmans always have had to work hard to make a decent living from the farm and have...
-
Breelynn received a company - wide memo describing how all employees who work from home would be required to install a new program on their work computers that would log each keystroke during work...
-
A dolphin emits an ultrasonic wave with a frequency of 1 0 7 kHz . Sound waves travel at 1 5 3 0 m / s in seawater. What is the wavelength of this sound in seawater? Report your answer in units of cm...
-
Share how you have overcome adversity or challenges in taking Pre Nursing class or taking prerequisites?
-
Consider the following income statement: Sales $ 875,904 Costs 569,856 Depreciation 129,600 Taxes 21 % Calculate the EBIT. Calculate the net income. Calculate the OCF. What is the depreciation tax...
-
A war between two countries.. If the first country lost 20% of the soldiers in the first war and lost 20% of the soldiers in the second war, and the total number of soldiers they lost was 7200.. How...
-
Discuss the types of test analysis. 1. Verify the data provided in the Unit, or the data selected by your group. 2. Construct a research question related to the data 3. Identify how to answer your...
-
Write about Real-world applications of the following tests, phenol red broth test, oxidase test, citrate test, phenylalanine deaminase test, starch hydrolysis test, bacitracin, novobiocin, optochin...
-
Show that gj concave AHUCQ Abadie For nonnegative variables, we have the following corollary.
-
Quince Interests is a partnership with a tax year that ends September 30, 2012. During that year, Potter, a partner, received $3,000 per month as a guaranteed payment, and his share of partnership...
-
How much of each of the following prizes or awards is taxable? a. Cheline received a $50,000 gift bag at the Oscars in 2012. b. Jon received a gold watch worth $350 for 25 years of service to his...
-
Kathy Kennedy (age 44) is a single taxpayer and she lives at 212 North Pine Way, Payson, AZ 85541. Her Social Security number is 467-98-9784. Kathy's earnings and income tax withholding as the...
-
What are the six books of original entry?
-
Why do we have day books? Why don't we just enter every transaction directly into the appropriate ledger accounts?
-
Where is the other side of the double entry for all these expense postings to the ledgers recorded?
Study smarter with the SolutionInn App