Created
April 27, 2016 11:47
-
-
Save sureshdsk/c55b208b687610e53118749da516061a to your computer and use it in GitHub Desktop.
Average sum of Squares
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def avgSumOfSquares(): | |
enter_input = True | |
number = "" | |
number_list = [] | |
while enter_input: | |
number = raw_input("Enter next number:") | |
print number | |
if number == "end": | |
enter_input = False | |
else: | |
number_list.append(float(number)) | |
squares = [x**2 for x in number_list] | |
total = sum(squares)/len(number_list) | |
print ("avg square of the sum of the square is ", total) | |
return total | |
avgSumOfSquares() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment