Skip to content

Instantly share code, notes, and snippets.

@orjanv
Created August 24, 2026 20:57
Show Gist options
  • Select an option

  • Save orjanv/4ac570db226ddac2bb3584ed56c16dc6 to your computer and use it in GitHub Desktop.

Select an option

Save orjanv/4ac570db226ddac2bb3584ed56c16dc6 to your computer and use it in GitHub Desktop.
Perfect square palindromes
NUM = 1000000
psp = []
for n in range(1, NUM):
square = str(n**2)
if square == square[::-1]:
psp.append(int(square))
print(psp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment