a = []
a = raw_input("Enter the string")
count = 0
for i in a:
count += 1
j = 0
while (j < count/2):
if(a[j] == a[count-j-1]):
j += 1
else :
print "Not a palindrome"
exit()
print "A palindrome"
A simple Palindrome checker
1 Response
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.