Answer the question
In order to leave comments, you need to log in
Python task using dictionary?
Create a dictionary of prospective student grades (Key - student's FI, value - list of student grades). Find the most successful and the most lagging behind in terms of average score.
the question is how to get the minimum and maximum average score from the dictionary
Answer the question
In order to leave comments, you need to log in
question from the series what color to choose for wallpaper: now get it from a person according to the method.
I'm lazy today
marks = {
'a' : [1,2,3],
'b' : [0,1,2],
'c' : [5,6,6],
'd' : [4,4,4]
}
def mean(lst):
return sum(lst) / len(lst)
sortedIds = sorted(marks.keys(), key=lambda studentId: mean(marks[studentId]))
print('лучший:', sortedIds[-1])
print('худший:', sortedIds[0])
best: c
worst: b
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question