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 ")
▶ RUN

Output/ Explanation:

Enter a String : nitin

nitin  is Palindrome String 


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

Enter a String : infomax

infomax  is not Palindrome String

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad