Finding the difference between the sum of the squares and the square of the sum was pretty easy, but my solution probably has too much white space for some people.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #sum of the squares some = 0 for i in range(101): some = some + i*i #square of the sums squar = 0 tempsum = 0 for i in range(101): tempsum = tempsum + i squar = tempsum * tempsum print abs(some - squar) |
On another note, I noticed my site looks like crap in Internet Explorer, but grandmas on their 386’s aren’t visiting this site anyway.