diff --git a/Algorithms/Palindrome/Palindrome.py b/Algorithms/Palindrome/Palindrome.py index e7dfb6671..9fad0171b 100644 --- a/Algorithms/Palindrome/Palindrome.py +++ b/Algorithms/Palindrome/Palindrome.py @@ -1,3 +1,7 @@ my_string = input("Enter a string") #Input a string -print("Palindrome") if my_string.lower()==(my_string.lower())[::-1] else #Traversing from both ends of the strings and checking if they are same -print("NotPalindrome") +if my_string.casefold()==(my_string.casefold())[::-1]: + print("Palindrome") + +else: + #Traversing from both ends of the strings and checking if they are same + print("NotPalindrome")