Arithmetic Formatter Question

Hi again! First, I’d like to thank those who have took the time to answer on my last post. Second, I’ve made some changes to the code in the project and I am very happy with where it’s at! However, at the present time, it’s only passing 4 out of 10.

I haven’t coded it yet to show the results, so failing the last two parameters is a given. HOWEVER, when I do my own testing on the other four that fail, I can’t see how it’s failing because when I run it, it comes out perfect, spacing and all, so I don’t understand how it’s failing.

Anybody care to check it out and let me know what they think the issue could be? Since I’m not seeing a problem in the terminal? I would be really grateful!

Here’s the link:

Taking a closer look at the output of one of the tests:

assert '  1         ...-    ------\n' == '  1         ...---    ------'

On the left is part of what function returned, on the right, part of what is expected.

Next part from the test output:

    1         1
  + 2    - 9380
- ---    ------
+ ---    ------
?              +

I’m not sure if line with - is here returned by the function, and with + is what is expected. Or is it the other way around. Either way the next line with ? and + suggests there’s a difference at the end of line with dashes.

1 Like

Thank you so much for responding! I’m soooo confused, lol! Not at your response, just the output of the test. It’s pretty much all strings so if there is an issue with the “+” or the “-” (which is a non-digit, by the way), there’s just shouldn’t be. I’m at a loss for what to do next… but I’ll keep trying!!

the left one is yours, you have an extra \n at the end of the string

1 Like

Yup. That’s it! Thank you so much!

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