Check the given number is palindrome or not. If not then add reverse of that number and check again. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Check the given number is palindrome or not. If not then add reverse of that number and check again.

For example: if number is 123 then add 321 to number and check it is palindrome or not. https://code.sololearn.com/cG9iURNOjZUr/?ref=app

5th Feb 2020, 7:42 AM
ClassHacker
ClassHacker - avatar
3 Answers
0
What exactly is your question?
5th Feb 2020, 7:46 AM
KnuckleBars
KnuckleBars - avatar
0
My question is take a number from user and check that number is palindrome or not. if not then add that number and reverse of that number and check it. If is it palindrome then print it else repeat above process.
5th Feb 2020, 7:52 AM
ClassHacker
ClassHacker - avatar
0
You can do that by making it first into a string and reverse it by using [::-1] and revert back to int and then add, and then back to str, use [::-1], equality test.
5th Feb 2020, 7:55 AM
KnuckleBars
KnuckleBars - avatar