Loading...
Loading...
Loading...
A number is a palindrome if it reads the same from the front and from the back, such as 1221. A ticket office gives a prize to palindrome ticket numbers.
Given a ticket number n, print Palindrome if it is one, otherwise Not palindrome.
Palindrome or Not palindrome.Example 1
Input
121
Output
Palindrome
Example 2
Input
123
Output
Not palindrome
Try the problem first. Open one hint at a time.
Reverse a copy of the number with % 10 and // 10.
Keep the original in another variable, because the loop destroys the copy.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor