Question: Fill in the code to complete the following method for checking whether a string is a palindrome. def isPalindrome ( s ) : if (

Fill in the code to complete the following method for checking whether a string is a palindrome.
def isPalindrome(s):
if (len(s)<=1): #Base case
return True
elif _________:
return False;
else:
return isPalindrome(s[1:len(s)-1])
1.(s[0]!= s[len(s)-1])// Base case
2.(s[1]!= s[len(s)])// Base case
3.(s[1]!= s([len(s)-1)]// Base case
4.(s[0]!= s[len(s)])// Base case

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!