Last active
August 29, 2015 14:10
-
-
Save yuan3y/fd0dc8a69d84df4cdfd4 to your computer and use it in GitHub Desktop.
abcd*e=dcba for ntu coe fb page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'yuan3y' | |
for i in range(1023, 4987): | |
for j in range(2, 10): | |
if i * j > 9999 or str(i).find(str(j)) > 0: | |
break | |
if str(i)[-1::-1] == str(i * j): | |
print(i, j, i * j) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using python list comprehension, the following code would do the same job: