Writing a program using 'from' keyword along with importing asterisk (*).Write a program to calculates sum, average and final grade of a student using * in import.import all the functions from Module_Imp3.py using *.Taken the scores of a student as input from user.Calculate the sum of scores using the calculate_sum function by passing scores as argument.Calculate the average of scores using the calculate_average function by passing scores as argument.Determine the final grade based on the average score using the determine_grade function.Note: The Module_Imp3.py already is written. Just follow the above instructions and complete the program.Sample Test CasesTest Case 1:Expected Output:Enter·the·scores·separated·by·spaces:·90 85 70 60 75Sum·of·scores:·380.00Average·score:·76.00Final·grade:·CTest Case 2:Expected Output:Enter·the·scores·separated·by·spaces:·85.5 76.5 90.0 82.0 95.5Sum·of·scores:·429.50Average·score:·85.90Final·grade:·B
Question
Writing a program using 'from' keyword along with importing asterisk (*).Write a program to calculates sum, average and final grade of a student using * in import.import all the functions from Module_Imp3.py using *.Taken the scores of a student as input from user.Calculate the sum of scores using the calculate_sum function by passing scores as argument.Calculate the average of scores using the calculate_average function by passing scores as argument.Determine the final grade based on the average score using the determine_grade function.Note: The Module_Imp3.py already is written. Just follow the above instructions and complete the program.Sample Test CasesTest Case 1:Expected Output:Enter·the·scores·separated·by·spaces:·90 85 70 60 75Sum·of·scores:·380.00Average·score:·76.00Final·grade:·CTest Case 2:Expected Output:Enter·the·scores·separated·by·spaces:·85.5 76.5 90.0 82.0 95.5Sum·of·scores:·429.50Average·score:·85.90Final·grade:·B
Solution
Here is a Python program that follows the instructions given:
# Importing all functions from Module_Imp3.py
from Module_Imp3 import *
# Taking scores as input from user
scores = list(map(float, input("Enter the scores separated by spaces: ").split()))
# Calculating the sum of scores
sum_scores = calculate_sum(scores)
print("Sum of scores: {:.2f}".format(sum_scores))
# Calculating the average of scores
average_score = calculate_average(scores)
print("Average score: {:.2f}".format(average_score))
# Determining the final grade
final_grade = determine_grade(average_score)
print("Final grade: {}".format(final_grade))
This program first imports all functions from Module_Imp3.py using the from keyword and the asterisk (*). It then takes the scores of a student as input from the user, calculates the sum and average of the scores using the calculate_sum and calculate_average functions, and determines the final grade based on the average score using the determine_grade function.
Please replace Module_Imp3 with the actual name of your module and make sure that the functions calculate_sum, calculate_average, and determine_grade are defined in that module.
Similar Questions
You have a class consisting of 5 students, each with a unique name and their respective marks. As the end of the semester approaches, you decide to assess the performance of your students and recognize their academic achievements.You write a Python program to categorize the students into different grades based on their marks. The program utilizes a Grade_analyzer class to represent each student and a StudentGradeAnalyzer function to analyze their grades. The function iterates through the list of students, calculates their grades and returns a dictionary containing the count of students in each grade.For grading:Students scoring between 80-100 will be in Grade A.Students scoring between 70-80 will be in Grade B.Students scoring between 60-70 will be in Grade C.Students scoring between 50-60 will be in Grade D.Students scoring below 50 will be in Grade E.Constraints:Input Format:5 lines of input, each line containing name and marks of each student.Ouptut Format:Should display items in dictionary which is holding Grades as keys and count of students falling under the grades as values.Example:Input:john 78missy 89sheldon 90mary 45meemaw 67Output:('A', 2)('B', 1)('C', 1)('D', 0)('E', 1)Explanation:input:--------Space saperated input name and marks for all the 5 students.john 78-->78 Falls into a range 70-80 so count of grade 'B' should be increased to 1.missy 89-->89 Falls into a range 80-100 so count of grade 'A' should be increased to 1.sheldon 90-->90 Falls into a range 80-100 so count of grade 'A' should be increased to 2.mary 45-->45 is less than 50 so count of grade 'E' should be increased to 1.meemaw 67-->67 Falls into a range 60-70 so count of grade 'C' should be increased to 1.
As a python student, write a program using functions and conditions to display the grades that the students will be receiving. The grades are:90% - 100% Grade is A 80% - 89% Grade is B70% - 79% Grade is C 60% - 69% Grade is D 50% - 59% Grade is E <50% Fail
Create a dictionary named summary_dict with keys "assignment", "project", "participation", "exam" and "final". The keys are associated with values mean_assignment, mean_project, mean_participation, mean_exam and mean_final of the previous question respectively.Write the dictionary summary_dict into a pickle file named grades.pkl.In [ ]:# import pickleimport pickle# store grades using picklesummary_file = 'grades.pkl'# your code here
# Write a function in python which accept a list of marks of students and return the# minimum mark, maximum mark and the average marks. Use the same function to test
If a student offered 12 subjects and the student's cumulative score is 1085. Write a program in python to show the student's average score.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.