Skip to content

splitbill: shares don't add up to the total for 3 people (bot test, will be closed) #43

Done

Description

@thejesh23

Did you search first?

  • I searched this repository's issues for my bug

What went wrong?

When the bill doesn't divide evenly, the shares don't add up to the total: a cent goes missing.

Steps to reproduce

python bug-hunt/splitbill.py 10 --people 3

What did you expect?

Shares of $3.34, $3.33 and $3.33, which add up to $10.00. README.md says "the shares always add up to the total, to the cent".

What happened instead?

Person 1: $3.33
Person 2: $3.33
Person 3: $3.33

splitbill version

splitbill 1.2.0

Python version

Python 3.13.1

Operating system

macOS 15.1

Activity

  1. added
    bug-hunt
    on Nov 26, 2026
  2. github-actions commented on Nov 26, 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 10 --people 3 and it doesn't do what README.md says.
    ✔ Versions are there.

    What I saw when I ran your command

    splitbill printed:

    Bill:  $10.00
    Tax:   $0.00
    Tip:   $0.00 (0%)
    Total: $10.00
    
    Person 1: $3.33
    Person 2: $3.33
    Person 3: $3.33
    

    README.md says it should print:

    Bill:  $10.00
    Tax:   $0.00
    Tip:   $0.00 (0%)
    Total: $10.00
    
    Person 1: $3.34
    Person 2: $3.33
    Person 3: $3.33
    

    🎉 Great report, @thejesh23! 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 26, 2026

    @thejesh23
    OwnerAuthor

    Test finished: the bot checked the report and re-checked it after an edit, as Lesson 09 says. Closing.

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