feat(solution): problem #6
parent
d110137e41
commit
4ce3e54c1b
|
|
@ -0,0 +1,12 @@
|
||||||
|
sumOfSquares = 0
|
||||||
|
squareOfSum = 0
|
||||||
|
|
||||||
|
for i in range(1,101):
|
||||||
|
squareOfSum += i
|
||||||
|
sumOfSquares += i * i
|
||||||
|
|
||||||
|
squareOfSum = squareOfSum * squareOfSum
|
||||||
|
|
||||||
|
difference = squareOfSum - sumOfSquares
|
||||||
|
|
||||||
|
print("The difference between the sum of the squares of the first one hundred natural numbers and the square of the sum is: ", str(difference))
|
||||||
Loading…
Reference in New Issue