Check wether the String is Palindrome - Coder's point

Saturday, June 1, 2019

Check wether the String is Palindrome

 
str=input("Enter a string:- ") rev = str[::-1] if (rev==str): print("String is Palindrome.") else: print("String is not Palindrome.")

 OUTPUT:  
 Enter a string:- Coders  
 String is not Palindrome  
 Enter a string:- malayalam  
 String is Palindrome  

No comments:

Post a Comment