MENU
Question -

Write a program to check whether the string is a palindrome or not.



Answer -

def palindrom ( ) :
str = input (“Enter the string”)
l = len (str)
P = l – 1
inex = 0
while (index < p) :
if (str[index] = = str [p]):
index = index + 1
p = p-1
else :
print “String is not a palindrom” break
else :
print “String is a palindrom”

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×