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 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz