MCPcopy Create free account
hub / github.com/BeeBombshell/Python-DSA / isPalindrome

Function isPalindrome

Recursion/is_Palindrome.py:3–9  ·  view source on GitHub ↗
(s, i)

Source from the content-addressed store, hash-verified

1'''A recursive Python program to check whether a string is palindrome or not'''
2
3def isPalindrome(s, i):
4 if(i > len(s)/2): #base case
5 return True
6 ans = False
7 if((s[i] is s[len(s) - i - 1]) and isPalindrome(s, i + 1)): #recursive step
8 ans = True
9 return ans
10
11str = "racecar"
12if (isPalindrome(str, 0)):

Callers 1

is_Palindrome.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected