Skip to content

Instantly share code, notes, and snippets.

View AshleyCoder3's full-sized avatar
๐ŸŽ†
Focusing

Ashley Burns AshleyCoder3

๐ŸŽ†
Focusing
  • Ilion, New York
  • 15:21 (UTC -04:00)
View GitHub Profile
@James-Hagerman
James-Hagerman / AverageOfTopFive.py
Created February 5, 2021 08:16
I use a dictionary to get the average test scores of multiple students stored in a nested array.
'''
Given a list of different students' scores, write a function that returns the average of each student's top five scores. You should return the averages in ascending order of the students' id numbers.
Each entry (scores[i]) has the student's id number (scores[i][0]) and the student's score (scores[i][1]). The averages should be calculated using integer division.
Example 1:
Input: [[1,91],[1,92],[2,93],[2,97],[1,60],[2,77],[1,65],[1,87],[1,100],[2,100],[2,76]]
Output: [[1,87],[2,88]]
Explanation: