Skip to content

splitbill: shares don't add up to the total for 3 people #30

Open

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 22, 2026
  2. github-actions commented on Nov 22, 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. changed the title [-]splitbill: bug[/-] [+]splitbill: shares don't add up to the total for 3 people[/+] on Nov 22, 2026
  4. thejesh23 commented on Nov 27, 2026

    @thejesh23
    OwnerAuthor

    Maintainer note: this issue stays open on purpose. Please don't close it.

    • It is the example of a finished bug report that the Lesson 09 video and written lesson show, at this address.
    • The bug it describes is planted in bug-hunt/splitbill.py for learners to find, so it will never be fixed. Closing the issue would make it look resolved.
    • Open issues are what learners see when they search before reporting, which is the first step the lesson teaches.

    Learners: finding this same bug is fine. Open your own report with the Bug hunt form; duplicates are expected here.

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