From 22bd6ff967fd8a983490e241485f950c0a82380c Mon Sep 17 00:00:00 2001 From: Maram Sumanth Date: Mon, 7 Oct 2019 23:56:40 +0530 Subject: [PATCH] Update average_mean.py (#1293) --- maths/average_mean.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/maths/average_mean.py b/maths/average_mean.py index e04b63be0..77464ef5d 100644 --- a/maths/average_mean.py +++ b/maths/average_mean.py @@ -3,17 +3,13 @@ def average(nums): """Find mean of a list of numbers.""" - sum = 0 - for x in nums: - sum += x - avg = sum / len(nums) - print(avg) + avg = sum(nums) / len(nums) return avg def main(): """Call average module to find mean of a specific list of numbers.""" - average([2, 4, 6, 8, 20, 50, 70]) + print(average([2, 4, 6, 8, 20, 50, 70])) if __name__ == "__main__":