Brute Force Approach
A Python project to determine whether a given number is a prime number, a power of another number, or neither.
This project was developed in my 1st year, 1st semester as part of the LifeSkills & Python program conducted by the ARJUNA Trust.**
- Prime Number Detection: Identifies if an input is a prime number.
- Power Detection: Checks if a number is a perfect power (can be expressed as ( a^b ) with integers ( a > 1, b > 1 )).
- User-Friendly Input: Simple prompts for any integer and displays the result.
- Educational Purpose: Demonstrates logical programming for beginners using Python.
- Python 3.x
-
Clone the repository
git clone https://github.com/DRV-Sai-Siddarth/Prime-Power.git cd Prime-Power -
Run the program
python prime_power.pyIf your main file has a different name, replace
prime_power.pywith its name. -
Follow the prompt
- Enter a number when asked.
- The output will state if the number is Prime, Power, or Neither.
Enter a number: 27 27 is a power (3^3).
Enter a number: 13 13 is a prime number.
Enter a number: 20 20 is neither a prime nor a power.
text
Prime-Power/ βββ prime_power.ipynb # Main Python script βββ README.md # Project documentation
text
- DRV Sai Siddarth P Sai Santhosh Kumar C Nikhil
- Project developed during the LifeSkills & Python program by ARJUNA Trust
This project is open-source and available for educational use.
Ready to check if a number is prime or a power? Clone and try it out!