Skip to content

Commit 7f11624

Browse files
Update 9. Palindrome Number.py
1 parent 15bfc49 commit 7f11624

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/easy/9. Palindrome Number.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class Solution:
22
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-
"""
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+
"""
88
str_forward = str(x) #convert x int to str
99
str_backward = str_forward[::-1] #reverse str
1010
return str_forward == str_backward #return comparison of forward and backwards str

0 commit comments

Comments
 (0)