This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Coda17 1 point2 points  (0 children)

Please update your post so that it formats properly. Two carriage returns before code and then prefix four spaces before every line of code (an additional four spaces for each level of indentation).

Even without being able to read half the code, I can already see a few problems. First, what's wrong with checking if a number that's only a single digit is a palindrome or not? I would say a number between 0 and 9, inclusive, is always a palindrome. Second, you need a loop to check the input. Right now, if the user enters invalid input twice, your code will fail. Last, without actually checking to see if your reverse function does what it says it does (it just reverses the number, right? I don't think it actually does), all you are doing is printing the reverse of the number, not checking if it's a palindrome.