Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4831c65

Browse files
committed
Create C-4-17.py
1 parent 13e7d32 commit 4831c65

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(str):
2+
3+
if len(str) <2:
4+
return True
5+
6+
if str[0] != str[-1]:
7+
return False
8+
9+
return isPalindrome(str[1:-1])
10+
11+
print(isPalindrome('racecar'))
12+
print(isPalindrome('hello'))

0 commit comments

Comments
 (0)