I have been working on a code that collecting students name and their score. Then printing their name, their score, their highest score, lowest score, and average score. I have completed to write a code that printing name,score, highest and lowest score.I have not completed average one. I have tried some codes but all of them have not worked so far. could you give me some advice or some code that I can use for the code, please? I visited some website to find some code that I can use for my code. In the code below I have tried with importing module, but it does not work. I look forward to hearing some great advice from you guys.
from statistics import median
from math import isnan
from itertools import filterfalse
def ScoreList():
scores = {'name': [], 'score': []}
while True:
name = input("Enter a name or enter 'done' when finished ")
if name == 'done': break
scores['name'] += [name]
score = input('Enter score ')
scores['score'] += [int(score)]
return scores
if __name__ == '__main__':
scores = ScoreList()
print(scores)
maxScore = max(scores['score'])
print("max score is:", maxScore)
minScore = min(scores['score'])
print("min score is:", minScore)
midScore = mid(scores['score'])
print("average score is", midScore)
I have visited some website to find some codes example that I can use for my code and all of them did not work so far.