Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python 3.16 Lab: Score Analysis Main.py grades_in.py This is my code and it's saying there's an error 3.16 Lab: Score Analysis Instructors use various quizzes
Python 3.16 Lab: Score Analysis
Main.py
grades_in.py
This is my code and it's saying there's an error
3.16 Lab: Score Analysis Instructors use various quizzes and tests to assess their student's performance. The results from the tests is a set of scores that are then analyzed to compute the average score, high score, low score, median score, and standard deviation. In addition the set can be sorted and printed. Write a programs to perform the analysis and print the results in the format given. The input will be a the scores with one score per line. A score of -1, indicates the end of the set of scores (-1 is not included in the analysis as it marks the end of input). To perform the input, a function read() is provided in the module grades_in.read() will return a list containing the input scores A list can be sorted using the sort method of the list type. Ex: list sort0. The sort method does not return a sorted list. Instead it will sort the list in place After sorting a list the lowest value will be the first value a list, highest will be the last value in the list, and the median will be the value at the index position determined by performing an integer division of the length of a list divided by 2. Average can be determined by dividing the sum of the list by the length of the list (floating division). Note: sum and len are builtin functions that will return the sum and length of a list respectively. The list is passed as an argument to these functions. Standard deviation can be determined by the pstdev function in the statistics module. A list is passed as an argument. Output average and standard deviation with two digits after the decimal point, which can be achieved as follows: print({:2f} format(your_value)) Ex: If the input is: 71 80 99 91 100 67 88 -1 Current file: main.py Load default template... 1 import grades_in 2 import statistics 3 grades = grades_in.read() 4 5 print("input scores: ") 6 print(grades) 7 print) 8 print("High Score: ") 9 print (sorted(grades)[0]) 10 print) 11 print("Low Score: ") 12 print (sorted(grades)[-1]) 13 print() 14 print("Average Scores: ") 15 print("{:.2f}".format(sum(grades)/len(grades))) 16 print() 17 print("medium score: ") 18 print (sorted(grades)[len(grades)//2]) 19 print) 20 print("Standard Deviation: ") 21 print("{:.2f}".Format(statistics.pstdev(grades))) 22 print) 23 print("Sorted Scores: ") 24 print(sorted(grades)) 25 print) Current file: grades_in.py - Load default template... Hom+noco 1 def read(): grades = [] while True: grade = int(input('Enter a value')) 5 if grade grades = grades_in.read() File "/home/runner/local/submission/grades_in.py", line 4, in read grade int (input('Enter a value')) ValueError: invalid literal for int() with base 10: '71, 80, 99, 91, 100, 67, 88Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started