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
REY [17]
3 years ago
10

(Analyze scores) Write a program that reads an unspecified number of scores and determines how many scores are above or equal to

the average and how many scores are below the average. Enter a negative number to signify the end of the input. Assume that the maximum number of scores is 100.
Here is a sample run:Enter a new score or negative number to exit: 99.1Enter a new score or negative number to exit: 85.6Enter a new score or negative number to exit: -1Total scores entered: 2Average score: 92.35Number of scores above or equal to the average: 1Number of scores below the average: 1

Computers and Technology
1 answer:
Angelina_Jolie [31]3 years ago
7 0

Answer:

#section 1

ls = []  

while True:

   score = float(input('Enter a New score or negative number to exit: '))

   if score < 0:

       break

   else:

       ls.append(score)

   

#section 2

average = sum(ls)/len(ls)

a = [num for num in ls if num >= average]

print('Total Scores Entered: ',len(ls))

print('Average score entered is: ',average)

print('Number of scores above average is: ',len(a))

print('Number of scores below average is:', len(ls)-len(a))

Explanation:

The programming language used is python 3.

#section 1

In this section, an empty list is initialized to hold all the values that will be inputted.

A while loop created which prompts the user to enter an input until a   negative value is entered. This while loop always evaluates to be true until a value less than 0 allows it to break.

Finally, all the scores are appended to the list.

#section 2

In this section the code gets the average by dividing the sum by the number of items in the list.

A new list 'a' is created to hold all the values that are greater than or equal to the average.

Finally, the results are printed to the screen.

I have attached an image with the example stated in your question.

You might be interested in
Why are high-quality transformers wound with large diameter wire?
lesya692 [45]
So that they can lower the I2R losses
8 0
4 years ago
To exclude members of a group from the basic permissions for a folder, which type of permission would you assign? Deny Allow Mod
oksano4ka [1.4K]

Answer:

Deny

Explanation:

Under the New Technology System, the Deny permission is applied when the administrator wants to overrule the permission given to members of a group. The Allow and Deny options help in regulating access to the components of the system. Only authorized groups are granted access to the files.

Most times, the Deny permission is considered before the Allow permission. If the user is denied access to some files and granted access to some, the deny permission is most times considered first.

4 0
3 years ago
How to control what is on the x and y axis in excel?
kozerog [31]
The value on X you choose first and create a graph then you add values to graphs Y axis.
8 0
3 years ago
Which of the following is NOT true about a flow chart?
SCORPION-xisa [38]
I think the answer is A
4 0
3 years ago
What parts of the computer does it not need to function?​
Thepotemich [5.8K]
Fancy lights, mouse, keyboard, you can do fan but the computer will eventually overheat, it need coolant for it to run for a long while
6 0
3 years ago
Other questions:
  • This provides an easy method for workers to use their computers.
    11·2 answers
  • When activating windows, which type of volume activation is used to activate multiple windows systems, but must be individually
    12·1 answer
  • Why is it so important that you know how much traffic dfs replication requires?
    13·2 answers
  • Florida Highway Safety and Motor Vehicles reported blank of traffic fatalities were alcohol-related in Florida in 2009.​
    8·1 answer
  • What is a sign of the brick and mortar and the virtual world meeting together?
    14·1 answer
  • PrimeFactorization.java: Write a program that begins by reading in a series of positive integers on a single line of input and t
    12·1 answer
  • How can a search be narrowed to only search a particular website????
    15·1 answer
  • The _____ method randomly rearranges the items in the list provided in the parentheses.
    5·2 answers
  • In a network, servers receive requests from which of the following?
    7·2 answers
  • A machine that converts energy to useful work.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!