Palindrome Number
Easy 20 XPMathStrings
Commonly asked at Amazon, TCS, Infosys
Read an integer and print Yes if it reads the same forwards and backwards, otherwise No. Negative numbers are never palindromes.
- Input
- One integer n.
- Output
- Yes or No.
Sample 1
Input
121
Output
Yes
Sample 2
Input
123
Output
No
Read input with input() (no prompt message) and print only the answer. Run tries the Input box; Submit checks all test cases.
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.The solution unlocks after 3 submissions.