Skip to content

Instantly share code, notes, and snippets.

@billyvg
Created September 9, 2011 23:40
Show Gist options
  • Save billyvg/1207625 to your computer and use it in GitHub Desktop.
Save billyvg/1207625 to your computer and use it in GitHub Desktop.
def challenge(number):
begin, end = divmod(number, 100)
middle = (number % 1000) / 10
return (begin + end) == middle
for x in xrange(1000, 9999):
if challenge(x):
print x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment