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

Appearance settings

Commit 722817f

Browse filesBrowse files
authored
Add Recursive check for palindrome (#57)
Add Recursive check for palindrome Co-authored-by: Abraham Hernandez <abraham@abranhe.com>
2 parents 6d2ad66 + d981917 commit 722817f
Copy full SHA for 722817f

File tree

1 file changed

+10
-0
lines changed
Filter options

1 file changed

+10
-0
lines changed

‎strings/recursive_palindrome.py

Copy file name to clipboard
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def checkString(string):
2+
string = string.lower()
3+
if(len(string) > 2):
4+
if(string[0] == string[-1]):
5+
return checkString(string[1 : -1])
6+
else:
7+
return False
8+
else: return string[0] == string[-1]
9+
10+
print(checkString(input("check word for palindrome: ")))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.