Created
April 16, 2017 19:26
-
-
Save ebovio/ce84d043c6db643e46f7e404f28cc81a to your computer and use it in GitHub Desktop.
This file contains 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
#Problem7 | |
def sumsquares_list(list): | |
sum_squares = 0 | |
for i in list: | |
x = i **2 | |
sum_squares += x | |
return sum_squares | |
#Main program below | |
list = [] | |
values= int(input("How many values you want in the list:")) | |
for i in range(values): | |
num = int(input("Write a value:")) | |
list.append(num) | |
print ("The sum of the squares of the list you provided is", sumsquares_list(list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment