Input a string and determine whether it is a palindrome or not
In this post I have shared python program about Input a string and determine whether it is a palindrome or not | Term I python practical for class 12 cbse computer science 083 new
#2.Input a string and determine whether it is a palindrome or not.
Source Code
string=input("Enter any string:")
length=len(string)
mid=length//2
rev=-1
for a in range(mid):
if string[a]==string[rev]:
print(string,"is a palindrome.")
break
else:
print(string,"is not a palindrome.")