Tirsvad 45648948cf
TirSystem/git-workflows: Publish wiki / publish-wiki (push) Skipped
TirSystem/git-workflows: Release / release (push) Skipped
TirSystem/git-workflows: Publish accepted milestones / publish (push) Skipped
TirSystem/git-workflows: Sync GitHub mirror metadata / sync-metadata (push) Successful in 13s
TirSystem/git-workflows: Validate / validate (push) Successful in 41s
TirSystem/git-workflows: OpenGrep / opengrep (push) Successful in 1m33s
Merge pull request 'Declare AGPL-3.0-or-later license in pyproject' (#3) from chore/license-metadata into main
Reviewed-on: #3
2026-11-15 04:44:36 +01:00
2026-11-15 11:38:03 +08:00
2026-11-15 11:38:03 +08:00

🚀 Tip Calculator

A beginner-friendly Python console app that splits a restaurant bill, including a tip, between friends.

📚 Table of Contents

🧭 Overview

Day 2 project from Udemy's 100 Days of Code: The Complete Python Pro Bootcamp. The program asks for the total bill, the tip percentage and the number of people, then prints what each person should pay, rounded to two decimal places.

Welcome to the tip calculator!
What was the total bill? $124.56
What percentage tip would you like to give? 10, 12, or 15? 12
How many people to split the bill? 7
Each person should pay: $19.93

The repository holds:

  • src/tip_calculator/: the calculation (calculator.py) and the console (main.py)
  • tests/: unit tests for the calculation
  • docs/: the artifact registry and the wiki (docs/wiki/, in English, Dansk and Bahasa Melayu)
  • framework/: the SQA and QC framework this project uses (git submodule)

📋 Requirements

  • Python 3.13 or newer
  • No runtime dependencies

🛠️ Setup

Create and activate a local virtual environment:

# Windows (PowerShell)
python -m venv .venv
.venv\Scripts\Activate.ps1
# macOS / Linux / Git Bash
python -m venv .venv
source .venv/bin/activate        # Git Bash on Windows: source .venv/Scripts/activate

Install the project in editable mode (required to run it from src/; also adds the tip-calculator command):

pip install -e .

Secrets such as repository tokens belong in a local .env file (see .env.example). .env is git-ignored; the app itself does not need it.

▶️ Run

python -m tip_calculator

or, after installing:

tip-calculator

🧪 Tests

python -m unittest discover -s tests

📄 License

Licensed under the GNU Affero General Public License v3.0.

📎 Appendix: Project documents

The documents a newcomer needs, in reading order.

Document What it tells you
AGENTS.md The rules AI agents follow in this repository
Artifact registry Where each artifact type lives, the next version, the PO language and domain
Wiki Install, usage, how the calculation works and how to test it
Framework README The framework this project uses
Framework changelog What changed in each framework release

S
Description
A beginner-friendly console app that splits a restaurant bill with a tip.
Readme AGPL-3.0
68 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 100%