Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
1
def
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
10
def
main():
11
average([2, 4, 6, 8, 20, 50, 70])
Callers
1
main
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected