We wrote the following program earlier in chapter 5 (Loops). It keeps accepting numeric inputs from user until he'she enters 'done'. Then calculates the average of all entered values.(try it) Rewrite this program using the concept of lists. That is, create a list from scratch and keep adding(appending) user inputs to that as its elements until the use types 'done". Then use appropriate python functions to calculate the average of elements in the resulted list.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

how do I do this in python

My Questions | bartle x
LCA 7- Lists and Tupl X
LCA7-Raw.ipynb: INT X
What method or ope
Home Page - Select
LCA7-Raw - Jupyter X
+
O localhost:8890/notebooks/LCA7-Raw.ipynb
ABP
: Apps University of Wisco...
M Inbox (3,786) - nujsi..
O HTML Color Codes
p5.js Web Editor | O...
TV Gogoanime - Watc..
3. Gains from trade...
Other bookmarks
E Reading list
>>
Cjupyter LCA7-Raw Last Checkpoint: 3 minutes ago (autosaved)
Logout
File
Edit
View
Insert
Cll
Kernel
Widgets
Help
Trusted
Python 3
+
Run
Code
In [ ]:
Assignment 2
We wrote the following program earlier in chapter 5 (Loops). It keeps accepting numeric inputs from user until he/she enters 'done'. Then calculates the
average of all entered values.(try it)
Rewrite this program using the concept of lists. That is, create
list from scratch and keep adding(appending) user inputs
tha
its elements until the use
types 'done'. Then use appropriate python functions to calculate the average of elements in the resulted list.
In [*]: total = 0
count = 0
while True :
inp = input ('Enter a number: ')
if inp == 'done' :
break
value = float(inp)
total = total + value
count = count + 1
average = total / count
print('Average:', average)
Enter a number:
In [ ]:
LCA7-Raw.ipynb
Show all
2:08 PM
2 Type here to search
3/25/2021
...
Transcribed Image Text:My Questions | bartle x LCA 7- Lists and Tupl X LCA7-Raw.ipynb: INT X What method or ope Home Page - Select LCA7-Raw - Jupyter X + O localhost:8890/notebooks/LCA7-Raw.ipynb ABP : Apps University of Wisco... M Inbox (3,786) - nujsi.. O HTML Color Codes p5.js Web Editor | O... TV Gogoanime - Watc.. 3. Gains from trade... Other bookmarks E Reading list >> Cjupyter LCA7-Raw Last Checkpoint: 3 minutes ago (autosaved) Logout File Edit View Insert Cll Kernel Widgets Help Trusted Python 3 + Run Code In [ ]: Assignment 2 We wrote the following program earlier in chapter 5 (Loops). It keeps accepting numeric inputs from user until he/she enters 'done'. Then calculates the average of all entered values.(try it) Rewrite this program using the concept of lists. That is, create list from scratch and keep adding(appending) user inputs tha its elements until the use types 'done'. Then use appropriate python functions to calculate the average of elements in the resulted list. In [*]: total = 0 count = 0 while True : inp = input ('Enter a number: ') if inp == 'done' : break value = float(inp) total = total + value count = count + 1 average = total / count print('Average:', average) Enter a number: In [ ]: LCA7-Raw.ipynb Show all 2:08 PM 2 Type here to search 3/25/2021 ...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education