mirror of
https://github.com/octocat/Hello-World.git
synced 2026-06-04 14:17:09 +00:00
Merge 1c9c9b38fb into 7fd1a60b01
This commit is contained in:
commit
592cbeec15
5
src/calculate_average.py
Normal file
5
src/calculate_average.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def calculate_average(values: list[float]) -> float:
|
||||
"""Return the arithmetic mean of values, or 0 if the list is empty."""
|
||||
if not values:
|
||||
return 0
|
||||
return sum(values) / len(values)
|
||||
Loading…
Reference in New Issue
Block a user