CJCoding With Joseph
15free / daySign inCreate account

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
Topics:
ListsPractice Problems
📥 Auto-Input:
121\n-454\n123\n7\n1001\n
This input is automatically fed to your program's stdin
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.