Skip to content

Commit 78808e7

Browse files
Added a palindrome checker for phrases/words/integers.
Added one file named is_string_palindrome.py Which checks if a given phrase/word or integer is in palindrome.
1 parent 03a4251 commit 78808e7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

maths/is_string_palindrome.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def is_string_palindrome(words: str) -> bool:
2+
cleaned_phrase = ''.join(words.split()).lower()
3+
return cleaned_phrase == cleaned_phrase[::-1]
4+
5+
if __name__ == "__main__":
6+
n=input("Enter a word:-")
7+
print(is_string_palindrome(n))

0 commit comments

Comments
 (0)