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
You have been asked to analyze the Excel data provided by your IT department. You would like to have the ability to sort and fil
Stolb23 [73]

Answer:

Sort data in a range or table

Excel for Microsoft 365 Excel for the web Excel 2021 Excel 2019 Excel 2016 Excel 2013 More...

Sorting data is an integral part of data analysis. You might want to arrange a list of names in alphabetical order, compile a list of product inventory levels from highest to lowest, or order rows by colors or icons. Sorting data helps you quickly visualize and understand your data better, organize and find the data that you want, and ultimately make more effective decisions.

You can sort data by text (A to Z or Z to A), numbers (smallest to largest or largest to smallest), and dates and times (oldest to newest and newest to oldest) in one or more columns. You can also sort by a custom list you create (such as Large, Medium, and Small) or by format, including cell color, font color, or icon set.

Notes:

To find the top or bottom values in a range of cells or table, such as the top 10 grades or the bottom 5 sales amounts, use AutoFilter or conditional formatting.

For more information, see Filter data in an Excel table or range, and Apply conditional formatting in Excel .

WindowsWeb

Sort text

Select a cell in the column you want to sort.

On the Data tab, in the Sort & Filter group, do one of the following:

To quick sort in ascending order, click A to Z command in Excel that sorts A to Z or smallest number to largest (Sort A to Z).

To quick sort in descending order, click Z to A command in Excel that sorts Z to A or largest number to smallest (Sort Z to A).

Explanation:

5 0
2 years ago
There's an App for That!
AleksandrR [38]

Answer:

Im confused man

Explanation:

6 0
3 years ago
Many company websites are now designed to do more than just sell a product. These​ websites, known as​ __________ websites, atte
Zinaida [17]

Answer:

brand community

Explanation:

Many company websites are now designed to do more than just sell a product. These​ websites, known as​ brand community websites, attempt to build closer customer relationships and generate engagement with and between the brand and its customers. These online communities bring together consumers who have shared interests in a brand or product. One advantage of online brand communities is that they reduce customer support costs as the business has more engagement with their customers.This also helps the business to retain customers through brand improvement centered around the customer's actual needs.

5 0
3 years ago
Can someone tell me how this is a SyntaxError! (Python3)
Basile [38]

Answer:

The expression on line 9 required 2 brackets

Explanation:

Given

The attached code

Required

Why syntax error.

The error points to line 10, but the error is actually from line 9

To get an integer input, the syntax is:

variable-name = int(input("Prompt"))

From the attached code, the line 9 is:

amount = int(input("Enter cheese order weight: ")

By comparing the syntax to the actual code on line 9, only 1 of the brackets is closed.

<em>This, in Python 3 is a sytax error</em>

6 0
3 years ago
Which statement best describes network security
Andreyy89
<span>B.network security means all personal information is kept safe the network is not compromised and only authorized users had access 

Im pretty sure they ment has instead of had</span><span />
3 0
2 years ago
Read 2 more answers
Other questions:
  • 4. Discuss the advantages and disadvantages of using the same system call interface for both files and devices. Why do you think
    5·1 answer
  • Which of the following describes a hash algorithms ability to avoid the same output from two guessed inputs?A. Collision avoidan
    12·1 answer
  • A computer application such as Microsoft Access that is used to store data and convert it into information is a ________________
    6·1 answer
  • loop Write a program to read a list of exam scores given as integer percentages in the range 0 to 100. Display the total number
    5·1 answer
  • The ____ command will confirm the system directory that you are currently in
    13·1 answer
  • You suspect a component in a computer is fried. You remove any unnecessary hardware devices one by one to narrow down where the
    7·1 answer
  • Universal Containers uses a custom field on the account object to capture the account credit status. The sales team wants to dis
    7·1 answer
  • What is a written or electronic document that outlines etiquette policies for using networks and network resources?
    8·1 answer
  • Which components exist in the contextual tab for tables called Design? Check all that apply.
    15·2 answers
  • What is the correct format to use when<br> inserting a date in Excel?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!