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]
2 years ago
6

Suppose we have a dictionary called grades as shown below:

Computers and Technology
1 answer:
mihalych1998 [28]2 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
Do all light bulbs server a practical purpose?
Greeley [361]

Answer:

A light bulb produces light from electricity

6 0
3 years ago
1. Ce este o baza de date? (1p)
lesya [120]

Answer:

would you mind telling me what this says im still learning my spanish

Explanation:

6 0
2 years ago
Read 2 more answers
the_____ tool is used to change the select text to capital letters or small letters (change case /grow font)​
solong [7]

Answer:

on word you can use shortcut "Shift+f3" to change uppercase lowercase and title case if that is what you are asking for

3 0
2 years ago
What is the difference between a Network Diagram and a Wiring Semantic?
stiks02 [169]

Answer:

Network diagram is the type of graphical networking chart that is basically used in the various type of computer telecommunication. The network diagram is useful for the networking designer and also for the network engineer for compiling the network documentation in detail.

Wiring semantic is the type of open source prototype platform which basically composed of the programming language and the IDE ( Integrated development environment). The wiring semantic consumer can affect the triggering the new data or information from the existing concepts.

7 0
3 years ago
Write a program that uses an STL List of integers. a. The program will insert two integers, 5 and 6, at the end of the list. Nex
poizon [28]

Answer:

answer:

#include <iostream>

#include<list>

using namespace std;

bool Greater(int x) { return x>3; } int main() { list<int>l; /*Declare the list of integers*/ l.push_back(5); l.push_back(6); /*Insert 5 and 6 at the end of list*/ l.push_front(1); l.push_front(2); /*Insert 1 and 2 in front of the list*/ list<int>::iterator it = l.begin(); advance(it, 2); l.insert(it, 4); /*Insert 4 at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl; l.erase(it); /*Delete the element 4 inserted at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl;

l.remove_if(Greater); for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " ";

/*Display the list*/

cout<<endl; return 0;

}

5 0
3 years ago
Read 2 more answers
Other questions:
  • Find and record a set of instructions containing a repetition clause (e.g., instructions on a shampoo bottle, a recipe, etc.). H
    11·1 answer
  • ________ symbol is used in the "Advanced" section of the time range picker to round down to nearest unit of specified time.
    8·1 answer
  • Which of the following is NOT essential for individuals to have to build their own web page?
    9·1 answer
  • Analog signals consists of individual electric pulses that represents bits group together into bytes {True/False}
    13·1 answer
  • Although highly accurate navigational information from the GPS constellation is exploitable by adversary forces, it is unlikely
    5·1 answer
  • What linux command is used to change file permissions?
    10·1 answer
  • what type of machine is a ramp for wheelchairs? compound machine, mechanical, machine complex machine, simple machine
    15·2 answers
  • Free brainliest!?! &lt;3​
    9·2 answers
  • Choose the correct term to complete the sentence.
    10·1 answer
  • Jade has to create a workbook for storing information of students participating in the annual state-level sports competition. Th
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!