We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15bfc49 commit 7f11624Copy full SHA for 7f11624
python/easy/9. Palindrome Number.py
@@ -1,10 +1,10 @@
1
class Solution:
2
def isPalindrome(self, x: int) -> bool:
3
- """
4
- isPalindrome returns true or false depending on if x int input is a palindrome number
5
- palindrome numbers are the same forward as they are backwards
6
- x: int (-231 <= x <= 231 - 1)
7
+ """
+ isPalindrome returns true or false depending on if x int input is a palindrome number
+ palindrome numbers are the same forward as they are backwards
+ x: int (-231 <= x <= 231 - 1)
8
str_forward = str(x) #convert x int to str
9
str_backward = str_forward[::-1] #reverse str
10
return str_forward == str_backward #return comparison of forward and backwards str
0 commit comments