Skip to content

Commit 39222f0

Browse files
authored
Merge pull request doocs#79 from ashwek/Palindrome
009 Palindrome Number - Python
2 parents a1a7740 + bd0d031 commit 39222f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def isPalindrome(self, num):
3+
"""
4+
:type num: int
5+
:rtype: bool
6+
"""
7+
if num < 0:
8+
return False
9+
10+
return str(num) == str(num)[::-1]

0 commit comments

Comments
 (0)