Tell us what’s happening:
Hi there, i’m having some trouble that doesn’t make sense to me. If i run the exact same code outside of the test_module.py, it works perfectly.
The issue is that the percentages in the chart come out wrong in the test_module. My code seems to work perfectly otherwise.
Percentage spent by category
100|
90|
80|
70|
60|
50|
40|
30|
20|
10| o
0| o o o
----------
B F E
u o n
s o t
i d e
n r
e t
s a
s i
n
m
e
n
t
and here is the expected output:
Percentage spent by category
100|
90|
80|
70| o
60| o
50| o
40| o
30| o
20| o o
10| o o
0| o o o
----------
B F E
u o n
s o t
i d e
n r
e t
s a
s i
n
m
e
n
t
This is running manually; I get the same results during testing. It looks like you are calculating the percent spent as a fraction of the amount in each category while the spec says to calculate the percent spent in each category as a fraction of the total spent, rounded down to the nearest 10%.