MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / average

Function average

Maths/average.py:1–8  ·  view source on GitHub ↗
(nums)

Source from the content-addressed store, hash-verified

1def average(nums):
2 sum = 0
3 n = 0
4 for x in nums:
5 sum += x
6 n += 1
7 avg = sum / n
8 print(avg)
9
10def main():
11 average([2, 4, 6, 8, 20, 50, 70])

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected