Error on test_module for budget app

Helo everyone.
I’m having some troubles with the test_create_spend_chart function in the test_module.py for the budget app. Thing is that when food is created, a deosit of 900 in done and then a withdraw of 105.55, which means that the percentage should be 10 when rounded to the nearest integer with one significant figure. That way create_spend_chart should add just two ‘o’ over the category in the chart. But in the test unit it is expecting like 6 ‘o’ over that category as if it were expecting that the percentage spent should be 60 which i can’t make a sense to it.

Please help. And thank you so much for reading me and any help

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0

Challenge: Budget App

Link to the challenge:

Checking again the code on test_module.py i’ve realize is expecting that percentage spent in entertainment category to be on the 10% level but using a deposit of 900 and withdraw of 33.40, percentage shouldn’t be near that value. I’m really confused!

You should calculate the percent as “spending in one category” / “total spending in all categories” rounded down to the nearest 10%. This is not unambiguously clear from the specifications.

1 Like

Mmmm… Oks oks! I did not understand the explanation to calculate the thing. My bad!
Thank you so much for your help!! I appreciate it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.