School Spirit
This commit is contained in:
17
schoolspirit.py
Normal file
17
schoolspirit.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
n = int(input())
|
||||||
|
scores = [int(input()) for _ in range(n)]
|
||||||
|
|
||||||
|
|
||||||
|
def calculate_score(scores: list) -> float:
|
||||||
|
return (1 / 5) * sum([score * ((4 / 5) ** i) for i, score in enumerate(scores)])
|
||||||
|
|
||||||
|
|
||||||
|
print(calculate_score(scores))
|
||||||
|
|
||||||
|
new_scores = []
|
||||||
|
for score in scores:
|
||||||
|
cpy_scores = scores.copy()
|
||||||
|
cpy_scores.remove(score)
|
||||||
|
new_scores.append(calculate_score(cpy_scores))
|
||||||
|
|
||||||
|
print(sum(new_scores) / len(new_scores))
|
||||||
Reference in New Issue
Block a user