Welcome to the Calculator Flet project! In this project, you will implement a command-line calculator with basic and advanced mathematical functions. A basic, yet powerful calculator app built using Python. This project demonstrates the use of fundamental programming concepts such as functions, conditionals, and loops. It allows users to perform basic arithmetic operations including addition, subtraction, multiplication, division and more.
-
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/Calculator.git cd Calculator
- Clone your forked repository to your local machine:
-
Implement the Functions:
- Open
backend.pyand implement the functions as described in the docstrings. - Test your implementation using the provided unit tests.
- Open
-
Project Setup:
Run the following command in your project's root directory:
python -m venv venv
python3 -m venv venv
This will create a new folder named
venv, which contains a clean Python environment.
Before installing dependencies, you need to activate the virtual environment.
venv\Scripts\activate
venv\Scripts\Activate.ps1
source venv/bin/activateOnce activated, your terminal prompt should show
(venv), indicating that the virtual environment is active.
Now, install everything listed in
requirements.txt:pip install -r requirements.txt
To confirm that
pytestandfletwere installed correctly, run:pip list
This should display pytest, flet.
-
Commit and Push Your Changes:
- Add your changes:
git add calculator_functions.py
- Commit your changes:
git commit -m "Implemented calculator functions" - 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.
In a few days, we will extend this project to create a mobile app using Flet. Stay tuned for updates!
To run the tests, use the following command:
pytest tests/test_calculator_functions.py- Only submissions from branches named after your name (e.g., monwabisi) will be accepted.
- Ensure your code is well-documented and follows best practices that we talked about.
- If you encounter any issues, feel free to ask for help!
Co-authored-by: Qiniso Xulu qiniso.nhlakanipho.xulu@gmail.com

