Average Mark
Imagine a list of marks where you need the average result without the decimal part. Write get_average, which takes a non-empty list marks, adds all the numbers, and divides the sum by the number of elements. The answer should be rounded down to an integer, so return the whole-number result.
Примеры
Ввод
[2, 2, 2, 2]Вывод
2Ввод
[1, 5, 87, 45, 8, 8]Вывод
25Ввод
[2, 2, 2, 1]Вывод
1Нужно реализовать
def get_average(marks: list[int]) -> int:
Теги
arraymath
Pieslēdzies, lai redzētu iesniegumu vēsturi
PieslēgtiesPieslēdzies, lai izmantotu AI mentoru
PieslēgtiesVisible tests
1
Input
[2,2,2,2]Expected
22
Input
[1,5,87,45,8,8]Expected
253
Input
[2,2,2,1]Expected
14
Input
[1,2,3,4,5]Expected
35
Input
[10]Expected
106
Input
[10,10]Expected
10Focus radio
Paused · SomaFM · Fluid