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
From the ages of 18 to 24, individuals born from 1980 to 1984 held an average of 6.2 jobs—which is slightly higher than the numb
Romashka [77]

Answer:

The parameters mentioned show how millennials have a much more marked tendency to job instability, that is, to change jobs more frequently than previous generations.

This is explained by two fundamental factors: on the one hand, the millennial generation differs from previous generations, especially because of their constant need for change and their greater emotional instability, which has a decisive influence on their constant and abrupt changes in their daily routines. , including their jobs; on the other, the deregulation of labor markets worldwide, which, on the one hand, have reduced the percentages of the unemployed population on the planet, but on the other hand, have given employers greater facilities to fire their employees, with which they they must change jobs more quickly.

3 0
3 years ago
How to remove special formatting from a table in word.
ch4aika [34]

Answer:

Clear Format

Explanation:

7 0
2 years ago
The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predica
baherus [9]

Answer:

1. Where,

2. From

Explanation:

In SQL query language when working on a database, a user can use certain clauses to carry out some functions.

Hence, The WHERE clause allows us to select only those rows in the result relation of the FROM clause that satisfy a specified predicate.

This is because the "Where clause" selects the rows on a particular condition. While the "From clause" gives the relation which involves the operation.

5 0
3 years ago
En un taller tienen dos taladros de sobremesa de 600 w de potencia, una sierra de calar de 500 w y cuatro soldadores de 50 w. Lo
sveticcg [70]

Answer:

El consumo del taller es de 3.7 kw/h.

Explanation:

Dado que el taller posee dos taladros de sobremesa de 600 vatios de potencia, que son utilizados durante 2 horas diarias; una sierra de calar de 500 vatios de potencia que es utilizada durante 1 hora diaria, y cuatro soldadores de 50 vatios que se utilizan durante 4 horas diarias, para medir el consumo diario de energía del taller es necesario realizar el siguiente calculo:

600 x 2 x 2 = 2,400 vatios de consumo taladros

500 x 1 x 1 = 500 vatios de consumo sierra de calar

50 x 4 x 4 = 800 vatios de consumo soldadores

2,400 + 500 + 800 = 3,700 vatios de consumo total

Pasado a kilovatios, el consumo del taller es de 3.7 kw/h.

4 0
2 years ago
If a driver who is under the age of 21 is stopped by a law enforcement officer and shown to have a BAL of .02 or greater, he or
n200080 [17]
Its actually BAC (clood Alchohol Content) and  it dependsn on what state you live in, and usually first time offenders with a BAC over 0.15 will have their license suspended for 90 days. but again it depends on the state. and anything below a 0.08% will just result in a warning but what state is it?
5 0
3 years ago
Other questions:
  • A person planning to file for bankruptcy must receive credit counseling within two years before filing the petition.
    7·1 answer
  • Carol typed a memo to send to everyone in her department. To create this memo, she used a _____. spreadsheet word processor fax
    10·2 answers
  • Declare an array named tax rates of five elements of type double and initialize the elements (starting with the first) to the va
    12·1 answer
  • 1. Do you agree that Facebook is the best social media platform to use for interpersonal communication? Why or why not?
    13·2 answers
  • To join a social network you create an avatar true or false
    6·2 answers
  • Katy and her associates are approached by an aged tai chi expert to create a website for him. From her participation in an onlin
    9·1 answer
  • Which of the following is true for an API?
    6·1 answer
  • Clasifica los documentos comerciales en activo, pasivo o patrimonial para cada operacion:
    14·1 answer
  • In the program below, numA is a _____.
    8·2 answers
  • Which of these are tools used to diagnose and test code? Check all of the boxes that apply.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!