Welcome to the Python Loops and Functions Project! In this project, you will practice working with for/while loops, if/else statements, and functions to solve challenging problems.
-
Fork the Repository:
- Click the "Fork" button on the top right of this repository to create your own copy.
-
Clone Your Fork:
- Clone your forked repository to your local machine:
git clone https://github.com/YOUR_USERNAME/Python102.git
- Clone your forked repository to your local machine:
-
Navigate to the Project Directory:
- Move into the project folder:
cd Python102
- Move into the project folder:
-
Set Up a Virtual Environment:
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
- Your terminal should now show the virtual environment name (e.g.,
(venv)).
- Create a virtual environment:
-
Install Dependencies:
- Install the required packages:
pip install -r requirements.txt
- Install the required packages:
-
Deactivate the Virtual Environment:
- When you're done working, you can deactivate the virtual environment:
deactivate
- When you're done working, you can deactivate the virtual environment:
-
Create a Branch:
- Create a branch with your name (e.g.,
lesego):git checkout -b YOUR_NAME
- Create a branch with your name (e.g.,
-
Complete the Tasks:
- Open
tasks.pyand implement the functions as described in the docstrings. - Test your implementation using the provided unit tests.
- Open
-
Run the Tests:
-
Commit and Push Your Changes:
- Add your changes:
git add tasks.py
- Commit your changes:
git commit -m "Completed tasks" - Push your changes to your branch:
git push origin main
- Add your changes:
-
Submit a Pull Request:
- Go to your forked repository on GitHub and click "New Pull Request".
- Select your branch (
YOUR_NAME) and submit the pull request to the main repository.
- Calculate the sum of squares of the first
nnatural numbers.
- Generate the first
nnumbers in the Fibonacci sequence.
- Check if a number is prime.
- Find the largest number in a list of numbers.
- Reverse the digits of a number.
- Check if a year is a leap year.
- Count the number of vowels in a string.
- Calculate the factorial of a number using a while loop.
- Calculate the grade based on a score.
- Validate a password based on specific rules.
To run the tests, use the following command:
pytest test_tasks.py