1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nataly_w [17]
1 year ago
8

Edit the program provided so that it receives a series of numbers from the user and allows the user to press the enter key to in

dicate that he or she is finished providing inputs. After the user presses the enter key, the program should print:
The sum of the numbers
The average of the numbers
An example of the program input and output is shown below:

Enter a number or press Enter to quit: 1
Enter a number or press Enter to quit: 2
Enter a number or press Enter to quit: 3
Enter a number or press Enter to quit:

The sum is 6.0
The average is 2.0

This is what I have but it just keep going with the numbers
# Edit the code below
theSum = 0.0
count = 0
while True:
number= input("Enter a number or press Enter to quit:")
if number=="":
break
theSum+=float(number)
count+=1
print("The sum is", theSum)
if count>0:
print("The average is ", theSum/count)
Computers and Technology
1 answer:
BlackZzzverrR [31]1 year ago
8 0

The edited and complete program is as follows

theSum = 0.0

count = 0

while True:

   number= input("Enter a number or press Enter to quit:")

   if not number:

       print("The sum is", theSum)

       if count>0:

           print("The average is ", theSum/count)

       exit()

   theSum+=float(number)

   count+=1

<h3>How to edit the program?</h3>

The complete program that calculates the average and the sum of numbers entered by the user is as follows:

Note that the program ends when the user presses the enter key and comments are used to explain each line

#This initializes the sum

theSum = 0.0

#This initializes the counter

count = 0

#This ensures the user enters numbers repeatedly

while True:

   #This gets the input

   number= input("Enter a number or press Enter to quit:")

   #When the user presses enter

   if not number:

       #This prints the sum and the average

       print("The sum is", theSum)

       if count>0:

           print("The average is ", theSum/count)

       #This exits the program

       exit()

   #This calculates the sum

   theSum+=float(number)

   count+=1

Read more about python programs at

brainly.com/question/26497128

#SPJ1

You might be interested in
Simple mail transfer protocol (smtp) uses the well-known port number ______________ by default.
Elden [556K]
I believe it's default is port 587. 
8 0
4 years ago
Read 2 more answers
Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
Tju [1.3M]

Answer:

Yahoo! mail

Explanation:

In the context, Dona travels most often around the world. While traveling, she has to access her emails from different location and at different times. But in order to keep her luggage light, she never carries the laptop with her. Therefore, Donna uses Yahoo! mail to access her emails.

Donna uses Yahoo mail because she can install the Yahoo! mail app in her phone or tablets which is small in size and of light weight. She is able to organize her Outlooks,  Google mails and  Yahoo accounts. In Yahoo! mail, Donna is also able to sign in with her any of the non yahoo accounts and it also provides free cloud storage space.

8 0
3 years ago
Read 2 more answers
Very complex type of processing is carried out by a which computer.
avanturin [10]

Supercomputers are used to process very complex type of processing. They are very powerful computers.

<h3>What are supercomputers?</h3>

Supercomputers are powerful computers that have very high processing and performance. They work very fast with in a fraction of second. They are used to doing heavy calculation and work.

Thus, the supercomputers are used to process very complex type of processing.

Learn more about supercomputers

brainly.com/question/23126369

#SPJ1

4 0
2 years ago
The computers in the administrative offices of the four schools throughout the district are networked to enable employees to acc
muminat
These computers in administrative offices or schools throughout the district that are networked to each other has the type of network most likely used by the workers is LAN network. Usually LAN networks are used in small offices or rooms.
3 0
4 years ago
Important of microcomputer in some point​
Sedbober [7]

Answer:

A microcomputer uses memory to store the programs that control its operation, to store data waiting for processing, and to store the results of operations performed by the CPU. Primary memory, or storage, is electronic memory that is directly addressable by the CPU.

Explanation:

brainliest plzzzzzzz

8 0
3 years ago
Read 2 more answers
Other questions:
  • Case project 5-1 Network Integration ​
    5·1 answer
  • When you create an internal hyperlink, you create the link that points to the bookmark using the anchor tag with which attribute
    15·1 answer
  • in some caes before carrying out a command a program may ask you to provide may ask you to provide more information or to make a
    6·1 answer
  • Which function will add a grade to a student's list of grades in Python? add() append() print() sort()
    5·2 answers
  • A web ______ is a computer that delivers requested webpages to your computer or mobile device.
    7·1 answer
  • What is website and what are the difference between website and blog pls anyone​
    6·2 answers
  • Write a calculate_sq_inches_of_good_pizza function that accepts the diameter of a pizza and returns the area of the pizza minus
    7·1 answer
  • A malware which acts like a spy in computer system is called ___?​
    15·2 answers
  • Q) Look at the code sequence and select the correct output
    14·1 answer
  • How long will it take to transfer a file size of 1gb on a usb 2.0 and a usb 3.0 drive?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!