defchallenge():sumOfSquares=0squareOfSums=0difference=0foriinrange(101):sumOfSquares+=i**2squareOfSums+=isquareOfSums=squareOfSums**2difference=squareOfSums-sumOfSquaresprint("The difference between the sum of squares and the square of sums up to 100 is {}".format(difference))
Output:
The difference between the sum of squares and the square of sums up to 100 is 25164150
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My take on this problem in python:
Output: