Skip to content

Instantly share code, notes, and snippets.

@andrefa
Created September 12, 2016 20:01
Show Gist options
  • Save andrefa/2657b1599af6dc2feffeb9e16c49100d to your computer and use it in GitHub Desktop.
Save andrefa/2657b1599af6dc2feffeb9e16c49100d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
naturals = 0
squares = 0
for i in xrange(101):
naturals += i
squares += i*i
naturals_square = naturals * naturals
diff = naturals_square - squares
print diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment