-
Notifications
You must be signed in to change notification settings - Fork 31
Issue 60: Total the expenses for every category #59
Copy link
Copy link
Open
Labels
difficulty: beginnerOne loop or one condition. If you know if and for, you can do thisOne loop or one condition. If you know if and for, you can do thisgood first issueGreat for your very first pull requestGreat for your very first pull requesthacktoberfestPart of the Hacktoberfest 2026 challengePart of the Hacktoberfest 2026 challengehelp wantedMaintainers would like community help hereMaintainers would like community help herestatus: claimedSomeone is working on this — pick a different oneSomeone is working on this — pick a different onetopic: aggregationTotals, averages and summaries over recordsTotals, averages and summaries over recordstopic: dictionariesCounting, grouping and looking things up by keyCounting, grouping and looking things up by key
Description
Activity
Metadata
Metadata
Assignees
Labels
difficulty: beginnerOne loop or one condition. If you know if and for, you can do thisOne loop or one condition. If you know if and for, you can do thisgood first issueGreat for your very first pull requestGreat for your very first pull requesthacktoberfestPart of the Hacktoberfest 2026 challengePart of the Hacktoberfest 2026 challengehelp wantedMaintainers would like community help hereMaintainers would like community help herestatus: claimedSomeone is working on this — pick a different oneSomeone is working on this — pick a different onetopic: aggregationTotals, averages and summaries over recordsTotals, averages and summaries over recordstopic: dictionariesCounting, grouping and looking things up by keyCounting, grouping and looking things up by key
The problem
Write a program that accepts a list of expenses containing person, category and amount and finds the total expense for every category.
The file
python-open-source-challenge/issue-60.pyThat is the only file you need to open, and the only one you should change.
The function you are fixing is
expense_totals(). There are 2# TODO:comments in it. Each one sits next to something that is wrong or missing — they are clues, not answers.What to do
/claimbelow. A bot assigns this issue to you.git checkout -b fix/issue-60AssertionError. That is expected — it is the work waiting for you.# TODO:comments and repair the code.All checks passed!Closes #59.How you know you are done
AssertionErrorAll checks passed!Nothing else counts as finished.
Rules
check_solution(). That is the marking scheme. Changing the test so it agrees with your code is not a fix.python-open-source-challenge/issue-60.py. One issue, one file, one pull request.What you will practise
What to expect: one loop or one condition. If you know
ifandfor, you have everything you need.No prior open source experience is assumed. This repository exists so that this can be your first pull request.
Stuck?
Read
check_solution()at the bottom of the file first. Theassertlines spell out exactly what the function should return for a given input, and that is often clearer than the description above.Still stuck? Comment here saying what you have tried. Asking is not failing.