diff --git a/solutions/006/sumsquaredifference.py b/solutions/006/sumsquaredifference.py new file mode 100644 index 0000000..faa8b18 --- /dev/null +++ b/solutions/006/sumsquaredifference.py @@ -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)) \ No newline at end of file