Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Leetcode_Palindrome_Number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""


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, 121 is palindrome while 123 is not.

"""
class Solution:
def isPalindrome(self, x: int) -> bool:
if(x<0):
return 0
else:
y = str(x)
y = y [::-1]
if(x==int(y)):
return 1
else:
return 0