Programming Examples

Python program to check the given string is palindrome or not


WAP to check the given string is palindrome or not.

Solution

s=input("Enter a String : ")
mid=len(s)//2
rev=-1
for a in range(mid):
    if s[a]==s[rev]:
        rev-=1
    else:
        print(s," is not Palindrome String");
        break;
else:
    print(s," is Palindrome String ")
Output

Enter a String : nitin

nitin  is Palindrome String 


======================== 

Enter a String : infomax

infomax  is not Palindrome String

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad