Skip to content

Commit

Permalink
Final QA (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
gahjelle authored Feb 7, 2024
1 parent b566d79 commit c222590
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pep8-beautiful-code/variance.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
def calculate_variance(number_list):
sum_list = 0
for number in number_list:
sum_list = sum_list + number
mean = sum_list / len(number_list)
def calculate_variance(numbers):
sum_numbers = 0
for number in numbers:
sum_numbers = sum_numbers + number
mean = sum_numbers / len(numbers)

sum_squares = 0
for number in number_list:
for number in numbers:
sum_squares = sum_squares + number**2
mean_squares = sum_squares / len(number_list)
mean_squares = sum_squares / len(numbers)

return mean_squares - mean**2

0 comments on commit c222590

Please sign in to comment.