2. Determine whether it's a palindrome (reads the same backward as forward). Example: kayak, madam and racecar are palindromes but hello and python are not. For simplicity, you can assume the string has no spaces or punctuation. You can’t use string[::-1] == string_ to check if the word is a palindrome.
Right Answer:
string=input("Enter a string value"
length=len(string)
for i in range(length):
if string[i] != string[-i-1]:
print("Not a palindrome")
break
else:
# This part is executed if the loop completes without breaking
print("It's a palindrome")
break