Python/maths/average_mean.py

17 lines
321 B
Python
Raw Normal View History

"""Find mean of a list of numbers."""
def average(nums):
"""Find mean of a list of numbers."""
2019-10-07 18:26:40 +00:00
avg = sum(nums) / len(nums)
return avg
def main():
"""Call average module to find mean of a specific list of numbers."""
2019-10-07 18:26:40 +00:00
print(average([2, 4, 6, 8, 20, 50, 70]))
2019-10-05 05:14:13 +00:00
if __name__ == "__main__":
main()