← Back to Lists
Question 149
Palindrome Numbers
Palindrome Numbers
Read five integers from input(), one per line with no prompts, into a typed list numbers. Then print, one per line and in input order, every number that reads the same backwards when its minus sign is ignored, such as 121, -454 or 7. Turn each number into text with str(abs(n)) so the sign disappears, reverse that text with the [::-1] slice, and compare the two; print the original number, sign included. Input: five integers. When none qualifies nothing is printed.
Expected Output:
121 -454 7 1001
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
ListsPractice Problems
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.