Answer:
def course_grader(student_to_grades, course_prefix):
student_grades = dict()
for key, value in student_to_grades.items():
grade_score = 0
for course,grade in value.items():
if course_prefix == course:
grade_score += grade
student_grades[key] = grade_score / len(value.keys())
return student_grades
Explanation:
The course_grader function is a python program that accepts two arguments, the student dictionary and the course prefix. The function returns a dictionary of the student id as the key and the average grade of the student as the value.
Answer:
computer science is the study of computer and computing as well as theoretical and practical applications.
pls give me thanks ☺️☺️
Answer:
Check the explanation
Explanation:
// include the necessary packages
import java.io.*;
import java.util.*;
// Declare a class
public class DataReader
{
// Start the main method.
public static void main(String[] args)
{
// create the object of scanner class.
Scanner scan = new Scanner(System.in);
// Declare variables.
boolean done = false;
boolean done1 = false;
float sum = 0;
double v;
int count = 0;
// start the while loop
while (!done1)
{
// start the do while loop
do
{
// prompt the user to enter the value.
System.out.println("Value:");
// start the try block
try
{
// input number
v = scan.nextDouble();
// calculate the sum
sum = (float) (sum + v);
}
// start the catch block
catch (Exception nfe)
{
// input a character variable(\n)
String ch = scan.nextLine();
// display the statement.
System.out.println(
"Input Error. Try again.");
// count the value.
count++;
break;
}
}
// end do while loop
while (!done);
// Check whether the value of count
// greater than 2 or not.
if (count >= 2)
{
// display the statement on console.
System.out.println("Sum: " + sum);
done1 = true;
}
}
}
}
Sample Output:
Value:
12
Value:
12
Value:
ten
Input Error. Try again.
Value:
5
Value:
nine
Input Error. Try again.
Sum: 29.0
Bob Kahn and Vint Cerf were both pioneers of the Internet, and Tim Berners-Lee was known for inventing the WWW.