Question: def isPalindrome ( words ) : result = for i in range ( 0 , len ( words ) + 1 ) :

def isPalindrome(words):
result =""
for i in range(0,len(words)+1):
for j in range(len(words)-1,0):
if words[i]== words[j]:
return true
else:
return false
s= "mom"
ans = isPalindrome(s)
if (ans):
print ("yes")
else:
print ("no")what is wrong with this code please give the correct code using two for loops

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 Databases Questions!