How to check whether a string is palindrome or not in Python

1 Answer

0 votes
s = "rotator"

if s == s[::-1]:
    print("Palindrome")
else:
    print("Not Palindrome")
    
   
    
'''
run:

Palindrome

'''

 



answered Aug 23, 2021 by avibootz

Related questions

1 answer 147 views
1 answer 178 views
1 answer 168 views
2 answers 202 views
4 answers 244 views
2 answers 262 views
...