Skip to content

Conversation

@haragam22
Copy link
Contributor

🚀 Submission Checklist

Thank you for contributing! Please check the boxes below to ensure a fast review.

  • My code is placed in the correct Languages/Python/SyntaxBasics/prime_check.py
  • My code is functional and includes necessary comments.
  • This PR addresses an existing issue.

🔗 Linked Issue

Closes #74


🧩 Description

Added a Python implementation of Prime Check under the SyntaxBasics section.
This program checks whether a number is prime using an efficient approach, demonstrating Python fundamentals like loops, conditionals, and input/output handling.


🧠 Features

  • ✅ Beginner-friendly Python code
  • 🔁 Efficient prime-checking using 6k ± 1 optimization
  • 🧩 Handles numbers less than 2 and larger inputs
  • 💬 Displays results clearly in the console
  • 🧠 Strengthens the Python SyntaxBasics folder with a fundamental math example

🧪 Example Run

Input:

17

Output:

17 is prime

🖥️ Verification

Tested locally using:

python Languages/Python/SyntaxBasics/prime_check.py

✅ Works for various test cases (e.g., 1, 2, 3, 16, 17, 23)
✅ Handles invalid or small inputs gracefully


🏷️ Commit Message

feat(Python): Add Prime Check implementation under SyntaxBasics

@haragam22
Copy link
Contributor Author

Please review these PRs @IamBisrutPyne
hacktober fest is about to end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(language): [Python/Primality Test]

1 participant