geekcomputers / geekcomputers/Python

Python Contribution

Open
#2,492 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
35.4k
Forks
12.9k
Avg merge
2h 37m
Merged PRs (30d)
1

Description

Incorrect Output in calculate_total Function

Description:I have encountered an issue in the calculate_total() function in the billing.py file. When I provide input with a list of prices, the total calculated is incorrect. The function does not seem to handle decimal values correctly.

from billing import calculate_total
prices = [12.99, 5.49, 8.75]
total = calculate_total(prices)
print(total)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open billing.py and inspect calculate_total first. Reproduce the issue with the price list shown in the report, then verify that decimal-valued prices produce the correct total. Done means the example no longer returns an incorrect result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.