Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Update Palindrome.py #1172

Merged
merged 1 commit into from
Oct 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Algorithms/Palindrome/Palindrome.py
Original file line number Diff line number Diff line change
@@ -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")