Skip to content

Instantly share code, notes, and snippets.

@nwg-piotr
Last active August 4, 2020 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nwg-piotr/fe12cb38478e8c6f70df054dafd0865d to your computer and use it in GitHub Desktop.
Save nwg-piotr/fe12cb38478e8c6f70df054dafd0865d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
for n in range(1000, 10000):
s = str(n)
result = (int(s[:2]) + int(s[2:])) ** 2
if n == result:
print(n)
exit(0) # actually it's unnecessary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment