Done
Labels
bug-huntPractice bug report for Lesson 09 (bug-hunt/splitbill.py)
Description
Did you search first?
- I searched this repository's issues for my bug
What went wrong?
A tip written with a percent sign, like 15%, crashes splitbill. The --help text and README say both 15 and 15% work.
Steps to reproduce
python bug-hunt/splitbill.py 100 --tip 15%What did you expect?
A tip of $15.00 and a total of $115.00. README.md says "15" and "15%" mean the same.
What happened instead?
Traceback (most recent call last):
File "bug-hunt/splitbill.py", line 61, in <module>
raise SystemExit(main())
^^^^^^
File "bug-hunt/splitbill.py", line 46, in main
tip_percent = parse_percent(args.tip)
^^^^^^^^^^^^^^^^^^^^^^^
File "bug-hunt/splitbill.py", line 18, in parse_percent
return float(text)
^^^^^^^^^^^
ValueError: could not convert string to float: '15%'
splitbill version
splitbill 1.2.0
Python version
Python 3.12.16
Operating system
macOS 26.3
Metadata
Metadata
Assignees
Labels
bug-huntPractice bug report for Lesson 09 (bug-hunt/splitbill.py)
Activity
github-actions commentedon Nov 26, 2026
🐞 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 --tip 15%and it doesn't do what README.md says.✔ Versions are there.
What I saw when I ran your command
splitbill printed:
README.md says it should print:
🎉 Great report, @divya0795! 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.
thejesh23 commentedon Nov 27, 2026
Reviewed. I could act on this straight away: one command, the README line it contradicts, and the full traceback as text. I'm closing it because the bug has to stay for the next learner. Closed here means reviewed, not rejected. Thank you!