Skip to content

Instantly share code, notes, and snippets.

@RamiAwar
Created October 2, 2021 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RamiAwar/45b90af59f9689abd38f35c4147db92b to your computer and use it in GitHub Desktop.
Save RamiAwar/45b90af59f9689abd38f35c4147db92b to your computer and use it in GitHub Desktop.
def post_exam_computation(exam_id):
exam_results = db.get(exam_id)
max_score = max(exam_results)
min_score = min(exam_results)
avg_score = sum(exam_results) / len(exam_results)
exam_stats = {"max": max_score, "min": min_score, "avg": avg_score}
db.save(exam_stats)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment