Palindrome Number
2022-08-18T15:36:04 - Vicky Chhetri
Read Time:21 Second
Given an integer x, return true if x is palindrome integer.
An integer is a palindrome when it reads the same backward as forward.
- For example,
121is a palindrome while123is not.
Python Solution
class Solution(object):
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
reverse=str(x)[::-1]
print(reverse)
if str(x)==reverse:
return True
return False