def is_palindrome(string): string = string.replace(" ", "").lower() print(string == string[::-1])

is_palindrome(input("Enter a string: "))

Built With

Share this project:

Updates