Skip to content

Commit 269e6ab

Browse files
committed
Edit: Delete if statement and return condition directely
1 parent 9877f42 commit 269e6ab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

valid-palindrome/Jay-Mo-99.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ def isPalindrome(self, s):
2525
temp = " ".join(re.split("[^a-zA-Z0-9]*",temp)).replace(" ","")
2626
#Compare with temp and reverse temp
2727
#If they are same, it is palindrome
28-
if temp == temp[::-1]:
29-
return True
30-
else:
31-
return False
28+
return temp == temp[::-1]
29+
30+
3231

3332

3433

0 commit comments

Comments
 (0)