Ask coding questions

← Back to all posts
How to get average of this grades without the lowest grade?
SMiludinovic (0)

Students do 5 exams, teacher promised not to count the lowest grade. I need to write average of that grades without the lowest grade. Working in python. Its for school.

Answered by IMayBeMe (341) [earned 5 cycles]
View Answer
Comments
hotnewtop
IMayBeMe (341)

Simple,

grades = [75, 86, 43, 98, 94, 67, 89, 85]
grades.sort()
del grades[0]
print(sum(grades) / len(grades))