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
In your memo, give three new employees directions for starting the computer and opening a word-processing document.
Lady_Fox [76]
Well 1st you power the computer on then u login with ur username and password the boss should give u, then go to the left corner click it search for microsoft word and click new document
7 0
3 years ago
What are the most popular/up-and-coming social media applications?
tekilochka [14]
How about vine camera? or musically?
7 0
2 years ago
Read 2 more answers
Manfred wants to include the equation for the area of a circle in his presentation. Which option should he choose?
Lesechka [4]

Answer: The answer is D Insert tab of the ribbon, choose equation and select the equation from the default options

Explanation:

When you go to the insert tab of the ribbon you choose equation and select the equation from the default options. I know this because I went back and I tried each one of these out and none of them made sense so it’s D. I also did the review and got it right

4 0
2 years ago
Read 2 more answers
______involves encoding information using fewer bits than the original representation Group of answer choices
stepan [7]

Answer:

The answer is "Data compression".

Explanation:

In the given question some information is missing, that is the option of the question, which can be described as follows:  

a) Data mining.

b) Information theory.

c) Data compression.

d) Image reconstruction.

Data compression is the mechanism, in which the bits arranges the data, that is changed. It encodes data, which needs less space is on the drive. It reduces the information instances and storage capacity, and other choices were wrong, which can be described as follows:

  • In option a, Data mining is used in row data searching, that's why it's not correct.
  • In option b, Information theory is used in communication, that's why it is wrong.
  • In option d, Image reconstruction is used in 3D design, that's why it is wrong.
5 0
3 years ago
It is important for security practitioners to take into consideration the __________ element when devising password security pol
N76 [4]

Answer:

The answer is "Evidence".

Explanation:

A "practitioner" is a person that has a specific practice or specialty directly involved. A safety professional of data is indeed another who engages in the protection of data.

Evidence is used in the course of the investigation to show certain material information or characteristics of a felony. Most people seem to believe that proof is just tangible, verbal evidence.

4 0
3 years ago
Other questions:
  • A ________ is a set of programs that manipulate the data within a database.
    12·1 answer
  • )in the link based implementation of the ADT sorted list what is the worst case time efficiency of the remove method?
    7·1 answer
  • How can you clean out the scales in an electric iron without taking the iron apart? A. By rinsing the tank and holes with a wate
    12·2 answers
  • A _______ is smaller than a notebook or laptop and has a touchscreen and sometimes a pointing device.
    13·1 answer
  • Which one of the following parts of a universal motor does not move? A. The armature B. The field coil C. The shaft D. The commu
    5·1 answer
  • Can someone help me, please
    7·1 answer
  • This isn't a question
    8·1 answer
  • Hey, how is everyone????????????????????????????????
    8·2 answers
  • The arrows in this question indicated the determination of two attributes. For example, the arrow that goes ProductID to Product
    11·1 answer
  • A source mainly provides <br> from a text or piece of media.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!