Skip to content

Instantly share code, notes, and snippets.

@sureshdsk
Created April 27, 2016 11:47
Show Gist options
  • Save sureshdsk/c55b208b687610e53118749da516061a to your computer and use it in GitHub Desktop.
Save sureshdsk/c55b208b687610e53118749da516061a to your computer and use it in GitHub Desktop.
Average sum of Squares
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