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
galina1969 [7]
3 years ago
6

Suppose we have a dictionary called grades as shown below:

Computers and Technology
1 answer:
mihalych1998 [28]3 years ago
6 0

Answer:

import statistics as st # importing statistics package to calculate mean as st.

grades = {"John": [87,90,86.8], "Mary": [78, 81.5, 88.6],"Susan":[45,67,76]}

for key,value in grades.items():#iterating over the dictionary

   average_score=st.mean(value)#calculating the mean of every student

   gr="" empty string to store the grades

   if average_score>=90: # nested if else if and statements for the grades in gr

       gr="A"

   elif average_score>=80.0 and average_score<90.0:

       gr="B"

   elif average_score>=70.0 and average_score<80.0:

       gr="C"

   elif average_score>=60.0 and average_score<70.0:

       gr="D"

   else :

       gr="F"

       

   print(str(key)+" "+str(average_score)+" "+str(gr)) #printing grades of every student.

Output:-Mary 82.7 B

John 87.93333333333334 B

Susan 62.666666666666664 D

Explanation:

1.In this program we are iterating over the dictionary grades.

2.Storing and calculating the mean of the scores of every student us statistics package.

3.Storing the grade in string gr and updating the gr according to the mean score

4.After that printing the grade of the student with their name and mean score.

You might be interested in
What would the range(3, 9) function generate?
gregori [183]

Answer:

A, 3,6,9

is the answer

Explanation:

bc it count by

3 0
2 years ago
How can I identify what is and what isn't an IP Address?
adelina 88 [10]

Answer:

you can identify an ip address in the bar where u type links

Explanation:

7 0
3 years ago
Digital learning can help students who enjoy
mr Goodwill [35]

Answer:

flexibility and independence

Explanation:

6 0
2 years ago
Is prediction harmful or not , why​
Marrrta [24]

Answer:

It's Not At All Because It's Just Like Yku Thinking Of Something

Explanation:

not at all

8 0
3 years ago
After you select your recipients, the next step in using the Mail Merge Wizard would be to _____.
NARA [144]

Answer:

Write your letter

Explanation:

When using a Mail Merge Wizard in a Microsoft Word Document, this is the process.

  • Click on your document type
  • Click on the starting document
  • Select the recipient(s)
  • Write your letter and add some custom fields
  • Insert your address Block
  • Strike enter and click on Greeting line (to enter a greeting)
  • Preview your letter and click on complete merge
3 0
3 years ago
Read 2 more answers
Other questions:
  • What is a block cipher algorithm that operates on 64-bit blocks and can have a key length from 32 to 448 bits?
    8·1 answer
  • What is the internet ?
    11·2 answers
  • The blank method returns an integer between the two provided numbers. It can take the value of either of the provided numbers
    12·1 answer
  • The most common clefs for high notes are what?
    6·2 answers
  • Which Backstage view feature helps you to specifically remove customized information from a document? Protect Document Feedback
    14·1 answer
  • What is a typical use for a MAN?
    13·1 answer
  • In Tynker, it is not possible to create a/an __________.
    6·2 answers
  • Which list shows a correct order of mathematical operations that would be used by a spreadsheet formula?
    6·1 answer
  • Is there apps/ websites like brainly?
    9·2 answers
  • If you have created users with administrator privileges on your windows 7 or linux systems, why bother creating other user accou
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!