The object grades
contains the test grades of students for 5 different tests.
-
Keys:
Student Name -
Values:
Array Containing 5 Test Grades
grades = {
'Ed' : [64, 73, 64, 24, 49],
'Daniel': [37, 73, 53, 95, 88],
'Dennis': [86, 97, 23, 66, 21],
'George': [96, 53, 75, 84, 96]
}
Write a function get_average(scores)
that takes in one argument scores
, which is an array of integers and return the average.
Input
get_average([1,2,3,4,5])
Output
3
Write a function get_averages()
that takes no arguments and prints out the name of each student followed by their test average.
Input
get_averages()
Output
Ed 54.8
Daniel 69.2
Dennis 58.6
George 80.8
Write a function get_highest_score(test_num)
that takes in one argument test_num
, which prints the name of the student who achieved the highest test grade on the test given by the test_num
argument.
Input
get_highest_score(1)
Output
George 96
Input
get_highest_score(2)
Output
Dennis 97
Write a function get_letter_grade(score)
that takes in one argument score
, which returns letter grade equivalent of a test score.
Grade | Letter |
---|---|
90 - 100 | A |
80 - 89.99 | B |
70 - 79.99 | C |
60 - 69.99 | D |
Below 60 | F |
Input
get_highest_score(100)
Output
A
Input
get_letter_grade(65)
Output
D
Write a function get_letter_grades(scores)
that takes in one argument scores
, which returns an array of letter grades as strings.
Grade | Letter |
---|---|
90 - 100 | A |
80 - 89.99 | B |
70 - 79.99 | C |
60 - 69.99 | D |
Below 60 | F |
Input
get_letter_grades([37, 73, 53, 95, 88])
Output
['F', 'C', 'F', 'A', 'B']
Write a function tests_summary(tests)
that takes in one argument tests
, which prints the test number and the test score shown in the example below.
Input
tests_summary([37, 73, 53, 95, 88])
Output
Test 1 : 37
Test 2 : 73
Test 3 : 53
Test 4 : 95
Test 5 : 88