Round Student Grades
A teacher wants to round final grades fairly and consistently for every student. The function grading_students receives a list grades, where each grade is from 0 to 100. If a grade is below 38, leave it unchanged; otherwise, round it up to the next multiple of 5 only when that multiple is less than 3 points away.
Примеры
Ввод
[73, 67, 38, 33]Вывод
[75, 67, 40, 33]Ввод
[37]Вывод
[37]Ввод
[38, 39, 40]Вывод
[40, 40, 40]Нужно реализовать
def grading_students(grades: list[int]) -> list[int]:
Теги
arraymath
Logi sisse, et näha esituste ajalugu
Logi sisseLogi sisse, et kasutada AI mentorit
Logi sisseVisible tests
1
Input
[73,67,38,33]Expected
[75,67,40,33]2
Input
[37]Expected
[37]3
Input
[38,39,40]Expected
[40,40,40]4
Input
[100]Expected
[100]5
Input
[0,1,2]Expected
[0,1,2]6
Input
[73,67,38,33,73]Expected
[75,67,40,33,75]Focus radio
Paused · SomaFM · Fluid