All pastes #1388425 Raw Edit

Project Euler #6

public python v1 · immutable
#1388425 ·published 2009-04-10 22:55 UTC
rendered paste body
def SumOfSquares(nmin,nmax):    total = 0.0    for i in range(nmin, nmax+1):        total += i*i    print('Sum of Squares: ', total)    return totaldef SquareOfTheSum(nmin,nmax):    total = 0.0    total = (((nmax+nmin)/2)*(nmax+1-nmin))    total *= total    print('Square of the Sum: ', total)    return totalprint('Difference between the sum of squares and the square of the sum: ', SquareOfTheSum(1,100) - SumOfSquares(1,100))