We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ca97d5 commit 44f362fCopy full SHA for 44f362f
palindrome/palindrome.py
@@ -15,16 +15,17 @@ def reverse(string):
15
16
def palindrome_test(word):
17
''' Returns true if a word is palindrome '''
18
- return remove_special_char(word) == reverse(remove_special_char(word))
+ return remove_special_char(word.lower()) == \
19
+ reverse(remove_special_char(word.lower()))
20
21
22
def main():
23
word = input("Type a word to test if it is palindrome: ")
24
is_palindrome = palindrome_test(word)
25
if is_palindrome:
- print(f"The word {word} is palindrome")
26
+ print(f"The word '{word}' is palindrome")
27
else:
- print(f"The word {word} isn't palindrome")
28
+ print(f"The word '{word}' isn't palindrome")
29
30
31
if __name__ == '__main__':
0 commit comments