diff --git a/Palindrome/README.md b/Palindrome/README.md new file mode 100644 index 00000000..561387b3 --- /dev/null +++ b/Palindrome/README.md @@ -0,0 +1,56 @@ +![Star Badge](https://img.shields.io/github/stars/ndleah/python-mini-project?style=social) +![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103) + +# Palindrome Checker + +## 🛠️ Description + +This open-source project contains a strict palindrome checker built using Python's `tkinter` module. The checker evaluates user input and determines if it is a **strict palindrome**, meaning it is **case-sensitive**, **space-sensitive**, and **punctuation-sensitive**. + +If you want, you can get the Python files and edit them as you want. Feel free to contribute to this repository. You can: +1. Improve functionality +2. Fix a bug +3. Or add a new cool feature + +Try to contribute as much as you can. Even a small contribution is enough. + +## ⚙️ Languages or Frameworks Used + +- Python +- Tkinter (built-in module – no installation required) + +No external libraries are needed. This project runs on standard Python 3.x installations. + +## 🌟 How to run + +You can type this command on your terminal to run the script: + +```bash +python Palindrome/palindrome.py +```` + +If this doesn't work, try: + +```bash +python3 Palindrome/palindrome.py +``` + +To stop it you can press `CTRL + C`. + +## 📺 Demo + +**1️⃣ Input is *not* a palindrome due to whitespace sensitivity (e.g., `"A man a plan a canal Panama"`):** + +![Non-Palindrome](screenshot1.png) + +**2️⃣ Input *is* a strict palindrome (e.g., `"madam"`):** + +![Strict Palindrome](screenshot2.png) + +## 🤖 Author + +This script is by AshnaParveen. + +GitHub: [AshnaParveen](https://github.com/AshnaParveen) + + diff --git a/Palindrome/palindrome.py b/Palindrome/palindrome.py new file mode 100644 index 00000000..171a0a72 --- /dev/null +++ b/Palindrome/palindrome.py @@ -0,0 +1,24 @@ +import tkinter as tk +from tkinter import messagebox + +def check_palindrome(): + text = entry.get() + if text == text[::-1]: + messagebox.showinfo("Result", "It's a palindrome!") + else: + messagebox.showinfo("Result", "Not a palindrome.") + +# GUI Setup +root = tk.Tk() +root.title("Palindrome Checker") + +label = tk.Label(root, text="Enter a string:") +label.pack(pady=5) + +entry = tk.Entry(root, width=30) +entry.pack(pady=5) + +check_btn = tk.Button(root, text="Check", command=check_palindrome) +check_btn.pack(pady=10) + +root.mainloop() diff --git a/Palindrome/screenshot1.png b/Palindrome/screenshot1.png new file mode 100644 index 00000000..1a108772 Binary files /dev/null and b/Palindrome/screenshot1.png differ diff --git a/Palindrome/screenshot2.png b/Palindrome/screenshot2.png new file mode 100644 index 00000000..2ef09564 Binary files /dev/null and b/Palindrome/screenshot2.png differ