Welcome to the Palindrome Checker program! This Python application determines if a given string reads the same backward as forward. It handles multi-line inputs, ignores non-alphanumeric characters, and is case-insensitive. Follow the instructions below to understand and use the program.
- Palindrome Detection: Checks if the input string is a palindrome.
- Multi-Line Input Support: Allows long inputs across multiple lines.
- Formatted Output: Provides clear and user-friendly messages with emojis.
- User Interaction: Prompts for continuous checks or exit.
- Ensure you have Python installed on your system (Python 3.6 or later recommended).
- Save the Python code into a file named
palindrome_checker.py
.
-
Open a terminal or command prompt.
-
Navigate to the directory where
palindrome_checker.py
is saved. -
Run the program using Python.
git clone https://github.com/mdriyadkhan585/palindrome-checker-python cd palindrome-checker-python python palindrome_checker.py
- Enter a String: When prompted, enter the string you want to check.
- For multi-line input, end each line with a backslash (
\
) to continue on the next line.
- For multi-line input, end each line with a backslash (
- View Results: The program will indicate whether the input string is a palindrome.
- Continue or Exit: After checking, you’ll be asked if you want to check another string.
- Type
y
orY
to check another string. - Type
n
orN
to exit the program.
- Type
Palindrome Checker Program
==============================
Enter a string: A man a plan a canal Panama
✅ The input string is a palindrome.
Do you want to check another string? (y/n): y
Enter a string: Hello, World!
❌ The input string is not a palindrome.
Do you want to check another string? (y/n): n
Thank you for using the Palindrome Checker!
==============================================
- Purpose: Checks if a string reads the same forward and backward.
- How It Works:
- Removes non-alphanumeric characters.
- Converts the string to lowercase and compares it with its reverse.
- Purpose: Formats text for improved readability.
- How It Works: Adds decorative lines for titles and returns plain text for other messages.
- Purpose: Manages user interaction and input processing.
- Features:
- Handles multi-line input.
- Checks if the input string is empty and provides feedback.
- Asks if the user wants to continue or exit.
- Input Issues: Ensure that input is provided correctly and multi-line input ends with a backslash.
- Python Errors: Verify you are using Python 3.6 or later and the code is saved properly.
Contributions are welcome! If you have suggestions or improvements, please submit pull requests or report issues via GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.