diff --git a/squares.py b/squares.py index 893e1db..03b9a64 100644 --- a/squares.py +++ b/squares.py @@ -2,7 +2,7 @@ def average_of_squares(list_of_numbers, list_of_weights=None): - """ Return the weighted average of a list of values. + """ Return the weighted average of squares of a list of values. By default, all values are equally weighted, but this can be changed by the list_of_weights argument. @@ -29,7 +29,7 @@ def average_of_squares(list_of_numbers, list_of_weights=None): for number, weight in zip(list_of_numbers, effective_weights) ] - return sum(squares) + return sum(squares)/len(squares) def convert_numbers(list_of_strings): @@ -38,7 +38,7 @@ def convert_numbers(list_of_strings): Example: -------- >>> convert_numbers(["4", " 8 ", "15 16", " 23 42 "]) - [4, 8, 15, 16] + [4.0, 8.0, 15.0, 16.0, 23.0, 42.0] """ all_numbers = []