How to check if string is palindrome in Python

1 Answer

0 votes
s = "abcba"

rev = ''.join(reversed(s))

if s == rev:
    print("Palindrome")
else:
    print("Not Palindrome")

'''
run:

Palindrome

'''

 



answered May 19, 2017 by avibootz
...