Skip to content

splitbill: tip is worked out on the bill plus tax #72

Done

Description

@reddy19231923-coder

Did you search first?

  • I searched this repository's issues for my bug

What went wrong?

When there is tax, the tip is worked out on the bill plus the tax, so the tip and the total are too high.

Steps to reproduce

python bug-hunt/splitbill.py 100 --tax 10 --tip 20

What did you expect?

A tip of $20.00 and a total of $130.00. README.md says "The tip is worked out on the bill before tax", and gives this exact example: a $100 bill, $10 of tax and a 20% tip.

What happened instead?

Bill:  $100.00
Tax:   $10.00
Tip:   $22.00 (20%)
Total: $132.00

Person 1: $132.00

splitbill version

splitbill 1.2.0

Python version

Python 3.13.14

Operating system

macOS 26.6

Activity

  1. added
    bug-hunt
    on Nov 28, 2026
  2. github-actions commented on Nov 28, 2026

    @github-actions
    Contributor

    🐞 Bug report check

    ✔ Title says what goes wrong.
    ✔ What went wrong is explained.
    ✔ Expected and actual results are both there.
    ✔ Steps reproduce a bug: I ran python bug-hunt/splitbill.py 100 --tax 10 --tip 20 and it doesn't do what README.md says.
    ✔ Versions are there.

    What I saw when I ran your command

    splitbill printed:

    Bill:  $100.00
    Tax:   $10.00
    Tip:   $22.00 (20%)
    Total: $132.00
    
    Person 1: $132.00
    

    README.md says it should print:

    Bill:  $100.00
    Tax:   $10.00
    Tip:   $20.00 (20%)
    Total: $130.00
    
    Person 1: $130.00
    

    🎉 Great report, @reddy19231923-coder! Someone who has never seen this bug can reproduce it from what you wrote. A maintainer will review your report.

    Please don't open a pull request that fixes it: the next learner needs the bug. Next up: Lesson 10, making the change.

  3. thejesh23 commented on Nov 28, 2026

    @thejesh23
    Owner

    Reviewed. A clear report: one command, the README sentence and example it contradicts, and the real output pasted as text. I'm closing it because the bug has to stay for the next learner. Closed here means reviewed, not rejected. Thank you!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-hunt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions