Get Palindromic
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
def Reverse(n): | |
res=str(n)[::-1] | |
return int(res) | |
n = int(input()) | |
for i in range(1,n+1): | |
rev = Reverse(i) | |
if i == rev: | |
print(i) |
Comments
Post a Comment
Please give us your valuable feedback