Skip to content
CodeItRaw
Code Reading
/
Palindrome Check
Path
Play
Daily
Leaderboard
tr
Bug Hunt
Palindrome Check
It should tell whether the text is a palindrome by walking in from both ends, but it crashes on every call. Find the line and the kind of bug.
Click the line you think is wrong.
1
def
is_palindrome
(s):
2
i, j =
0
,
len
(s)
3
while
i < j:
4
if
s[i] != s[j]:
5
return
False
6
i +=
1
7
j -=
1
8
return
True