I’m sorry in advance if my code is a little rough I am still fairly new to this and am trying to complete these projects without looking at other code for help. I have been messing around with this one over the past couple days and cant get two of the tests to pass and I’m not sure I understand the error codes correctly…
Any help would be greatly appreciated!
For the string test, the test calls
str(obj) on an object of class
Category that you define.
str(obj) does not call the class’s
to_string method, but rather another function in a standardized location. Check the documentation for
For the category test, set the
self.maxDiff = None for the test and look at the difference. You’re missing some of the bars. Your percents should be the percent in each category of the total spent, not the percent spent of each category’s budget.
Thank you @jeremy.a.gray for your quick reply! after doing some tinkering I have managed to get it to pass all the tests
setting the self.maxDiff = None is a nice little trick that helped me quite a lot in understanding where I was going wrong.
After doing some research into this i think I understand that you need to define a str method in your class to make this possible? If not it worked for now and I will hopefully continue to get better with every code
Thanks again for your time and help!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.