I was given a task in python to write a code which contains a function which receives an input number from the user and if it isn't a palindrome - it finds the nearest (lower) palindrome number, for example:
findprevpalindrom(100) to 99
findprevpalindrom(99) to 88
findprevpalindrom(11) to 9
- We presume the input is int and above 0, so no need to fix that part.
- Singular numbers are palindrome.
- I am required to use another function for finding the proper number.
This is what I've done so far. It isn't correct and I'm having a hard time understanding what's next: screenshot
Thanks in advance to all helpers!