[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-11-17 17:34:44 +00:00
parent e6721afb22
commit 6145f97757

View File

@ -1,10 +1,11 @@
def is_palindrome(input_value):
# Convert the input to a string and remove spaces and special characters (for phrases)
sanitized_value = ''.join(filter(str.isalnum, str(input_value))).lower()
sanitized_value = "".join(filter(str.isalnum, str(input_value))).lower()
# Check if the sanitized string is equal to its reverse
return sanitized_value == sanitized_value[::-1]
input_value = input("Enter a phrase, word, or number to check if it's a palindrome: ")
if is_palindrome(input_value):
print("The input is a palindrome.")