1.

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” 



Discussion

No Comment Found