Skip to content

Commit 6145f97

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e6721af commit 6145f97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

strings/word_phrase_int_palindrome.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
def is_palindrome(input_value):
22
# Convert the input to a string and remove spaces and special characters (for phrases)
3-
sanitized_value = ''.join(filter(str.isalnum, str(input_value))).lower()
4-
3+
sanitized_value = "".join(filter(str.isalnum, str(input_value))).lower()
4+
55
# Check if the sanitized string is equal to its reverse
66
return sanitized_value == sanitized_value[::-1]
77

8+
89
input_value = input("Enter a phrase, word, or number to check if it's a palindrome: ")
910
if is_palindrome(input_value):
1011
print("The input is a palindrome.")

0 commit comments

Comments
 (0)