Budget App: Can't figure out what's wrong

Hello!

So the code prints fine and does everything as it should, but it’s not being accept by repl.it. From other posts on this forum I assume it’s a formatting issue, but, I can’t seem to figure out where the problem arises. Any help will be appreciated, thanks in advance.

Your code so far
Budget App Link

Your browser information:

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

Challenge: Budget App

Link to the challenge:

The code snipped of the error-message reads:

'Perc[25 chars]n100|\n 90|\n 80|\n 70|    o\n 60|    o\n 50| [286 chars]   t' != 'Perc[25 chars]n100|          \n 90|          \n 80|         [349 chars] t  '

Putting that on two lines:

'Perc[25 chars]n100|\n 90|\n 80|\n 70|    o\n 60|    o\n 50| [286 chars]   t' 
'Perc[25 chars]n100|          \n 90|          \n 80|         [349 chars] t  '

The first line is your output, the second line the expected output. A quick glance at your code suggest you are using an .rstrip() or so, deleting the spaces which you are supposed to keep.

I deleted the .rstrip() as you suggested and it still didn’t work. I thought it could be how I did the bars in a list, but it’s not that as I’ve rewritten that section. Honestly, I can’t see what the problem is now.

New Code:

Updated Version

I think there are two minor errors.

'Perc[170 chars] 10| o  o  o  \n  0| o  o  o  \n    ----------[206 chars]  \n'
'Perc[170 chars] 10|    o  o  \n  0| o  o  o  \n    ----------[204 chars] t  '

First thing to notice is your output has “o” in the 10-row for Business, but it should be " ". So I guess you got a rounding mistake there → the task is to ALWAYS round down to the nearest 10.

Second thing is your output ends with “/n” while the expected output doesn’t.

I had not noticed the rounding down thing, so I really appreciate you pointing that out!

Also, I browsed other codes on here and noticed the additional line and had amended it.

Once again, thank you for the help! =]

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