def reverse(s): return s[::-1] n=int(input()) sum=0 while(True): r=reverse(str(n)) sum=n+int(r) if(str(sum)==reverse(str(sum))): break else: n=sum print(sum)
To embed this program on your website, copy the following code and paste it into your website's HTML: