Skip to content

Instantly share code, notes, and snippets.

@kevinjqiu
Created July 15, 2012 15:27
Show Gist options
  • Save kevinjqiu/3117415 to your computer and use it in GitHub Desktop.
Save kevinjqiu/3117415 to your computer and use it in GitHub Desktop.
square palindrome
print [ x*x for x in xrange(1000) if list(str(x*x)) == list(reversed(str(x*x)))]
$ python foo.py 
[0, 1, 4, 9, 121, 484, 676, 10201, 12321, 14641, 40804, 44944, 69696, 94249, 698896]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment