forked from TheAlgorithms/Python
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaverage.py
More file actions
Latest commit
20 lines (14 loc) · 371 Bytes
/
Copy pathaverage.py
File metadata and controls
20 lines (14 loc) · 371 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Find mean of a list of numbers."""
defaverage(nums):
"""Find mean of a list of numbers."""
sum=0
forxinnums:
sum+=x
avg=sum/len(nums)
print(avg)
returnavg
defmain():
"""Call average module to find mean of a specific list of numbers."""
average([2, 4, 6, 8, 20, 50, 70])
if__name__=='__main__':
main()