Scientific Computing with Python Projects - Budget App

Okay, so I’ve managed to troubleshoot the errors out of my code over the past couple of hours, but now I’m running into an issue with this project. My problem comes specifically from the “test_create_spend_chart” test. When the Repl.it runs, the code in the main.py calls the spend chart function and it runs/prints correctly. When I run the code independently on my machine, it runs/prints correctly as well. However, when it gets to the test code, it formats like this:

Your code so far
https://replit.com/@bakramer/boilerplate-budget-app#budget.py
There’s my Repl.it. I’m not sure why it’s not printing correctly the second time through when I press run.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Challenge: Scientific Computing with Python Projects - Budget App

Link to the challenge:

Below the error it should tell you, the string it expected and the one your code returns, possibly an extra space.

- Percentage spent by category 
?                             -
+ Percentage spent by category
-  10| o  o  o  
?            ---
+  10|    o  o  
?      +++
-            t  
?               -
+            t   

Here is a colorized diff

Okay, so the reason it’s spitting some lines out multiple times is because those are the ones where errors are at? That makes sense. I thought my code was just outputting it looking like that, and it made no sense to me. I can figure it out from there, thanks!

Yup. You have 2 extra characters and a rounding logic error.

Something like this: AssertionError:
'Perc[193 chars] o o\n ----------\n B F E \n [181 chars] t ’ != 'Perc[193 chars] o o \n ----------\n B F E \n [181 chars] t ’ you must compare both to see the error.