Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8fa467e

Browse files
add solution in Python for 0009_palindrome_number.py
1 parent b742851 commit 8fa467e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def isPalindrome(self, x: int) -> bool:
2+
string = str(x)
3+
i = 0
4+
j = len(string) - 1
5+
6+
while (i < j):
7+
if (string[i] != string[j]):
8+
return False
9+
i += 1
10+
j -= 1
11+
12+
return True

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /