Same Forward and Back

A palindrome is a value that reads the same from left to right and from right to left. Given an integer x, return True if it is a palindrome. Negative numbers do not count as palindromes because the minus sign appears only on the left.

Примеры

Ввод
121
Вывод
True
Ввод
-121
Вывод
False
Ввод
10
Вывод
False

Нужно реализовать

def is_palindrome_number(x: int) -> bool:

Теги

math
PostgreSQLv16

Tukaj bo rezultat izvajanja kode

Visible tests
1
Input
121
ExpectedTrue
2
Input
-121
ExpectedFalse
3
Input
10
ExpectedFalse
4
Input
0
ExpectedTrue
5
Input
12321
ExpectedTrue
6
Input
7
ExpectedTrue
Focus radio
Paused · SomaFM · Fluid