Answer to Question #61844 in Python for kelly

Question #61844
Use two variables k and total to write a for loop to compute the sum of the squares of the first 50 counting numbers, and store this value in total. Thus, your code should put 1*1 + 2*2 + 3*3 +... + 49*49 + 50*50 into total. Use no variables other than k and total.
1
Expert's answer
2016-09-08T10:07:03-0400
total = 0
for k in range(1,51,1): total += k*k

print(total)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
05.12.18, 18:20

Dear Escamilla, you're welcome!

Trey Escamilla
05.12.18, 18:17

This really helped me thanks !

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS