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
Researchers conducted a 'natural experiment' to examine the effects of on-site food services on weight gain among first-year col
anygoal [31]

Answer:

On-site food services is the INDEPENDENT variable and the weight gain is the DEPENDENT variable

Explanation:

Variables can be dependent or independent. An independent variable is the one used by the researcher to test its degree of influence on the dependent variable. The dependent variable, as the name implies, relies on changes in the independent variable to effect its own changes.

In the question, it is obvious that weight gain among the first year students is dependent on on-site food services

7 0
3 years ago
Why were video games invented?
Alenkinab [10]
The answer is in the following website: https://www.reference.com/history/were-video-games-invented-e9413d3dc1378766


4 0
3 years ago
Suppose a book author can be identified by an AuthorID and each book can be identified by an ISBN. Besides the identifier, an au
Scrat [10]

Answer:

a) We know that atleast one or more author writes a book.

Symbol to indicate one or more is (B)

So the correct option is B

b) We know that zero to multiple books are written by any author.

Symbol to indicate zero or more is (A)

So the correct option is A

c) The fourth option is correct if we replace by many to many relationship and generate a new entity.

So the relationship betweem author and contract is one to many. So we know that there is atleast one author that represent in symbol d and books has atleast 0 that represent in symbol c.

So Fourth Option is correct d at blue side and c at red side.

d) There are two forirgn keys in table Contract one is from AuthorId and other is ISBN.

So correcct option is C

6 0
3 years ago
A search will _____ determine the index of the goal.
Lapatulllka [165]

Answer:

The correct answer is C. Sometimes.

Explanation:

A database index is a structure that aims to speed up selections and selective operations on a database. An index reduces the number of comparisons required to find one or more database records. This avoids having to perform a so-called full table scan, whereby all records in the table have to be run through sequentially.

Therefore, if the search does not focus correctly on the necessary data, this search will not always determine the index of the goal. Therefore, the user must correctly handle the search keywords to collaborate with the system.

4 0
3 years ago
How can I order the prices negatively affect other producers of goods and services​
Nikolay [14]
Scarcity of availability causes producers to either charge
higher prices or to produce more goods and services (like energy
production, cars, paper, etc.)
7 0
3 years ago
Other questions:
  • When you declare a string data type, you are actually creating an object from the?
    5·1 answer
  • How do you take a screenshot on an iPhone?
    8·2 answers
  • URGENT!!!
    13·2 answers
  • Which part of a formal email is optional
    6·2 answers
  • Impaired drivers are one of the many risks drivers face on the Highway Transportation System. List 3 signs that a driver could b
    10·2 answers
  • A label control may be added to a form by double-clicking on the Label control icon in the ________ window.
    15·1 answer
  • In confirmatory visualization Group of answer choices Users expect to see a certain pattern in the data Users confirm the qualit
    9·1 answer
  • 1
    13·1 answer
  • How many times should the start function be defined in a program?
    12·1 answer
  • The unit we use to measure bending moment is...<br> A kg<br> B N<br> C Nm<br> D MPa
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!