1 2 3 4 5 6 7 8 9 10 11
def sumofsquares(n): sum = 0 for x in range(1,n+1): sum+=(x*x) return sum def squareofsum(n): sum = 0 for x in range(1,n+1): sum+=x return (sum*sum) print(squareofsum(100) - sumofsquares(100))