Class Average

Easy · rating 900 · arrays, math

The first line contains n. The second line contains n exam scores. Print the average, rounded down to the nearest integer.

Editorial

Class Average computes the mean score, rounded down. Sum the scores and use integer division by the count.

print(sum(scores) // len(scores))

Complexity

Time: O(n). Space: O(1).

Open Class Average in Code Arena →