def isPalindrome(str1):
return str1 == str1[::-1]
if __name__ == '__main__':
str2 = input("Enter a string: ")
res = isPalindrome(str2)
if res:
print(str2,"is Palindrome")
else:
print(str2,"is not Palindrome")
Comments
Leave a comment