I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
this is error i am getting sorry for replying late my pc took long time too bootup
FAIL: test_solutions (test_module.UnitTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/boilerplate-arithmetic-formatter-6/test_module.py", line 39, in test_solutions
self.assertEqual(actual, expected, 'Expected solutions to be correctly displayed in output when calling "arithmetic_arranger()" with arithmetic problems and a second argument of `True`.')
AssertionError: 'Error: Numbers must only contain digits.' != ' 32 1 45 123\n- 698 [89 chars] 172'
- Error: Numbers must only contain digits.
+ 32 1 45 123
- 698 - 3801 + 43 + 49
----- ------ ---- -----
-666 -3800 88 172
: Expected solutions to be correctly displayed in output when calling "arithmetic_arranger()" with arithmetic problems and a second argument of `True`.
----------------------------------------------------------------------
Ran 6 tests in 0.007s
FAILED (failures=3, errors=1)
Hi , i will try to help.
Here you should put “not” for op2.isdigit() as well (right after “or”) because otherwise you only check for op1 and every time op2 IS a number the func returns the ‘Error: Numbers must only contain digits’…
That’s why you get:
This means that the func returned Error: Numbers must only contain digits. instead of 32 1 45 123\n- 698 [89 chars] 172
Also the spacing for the first line is wrong but you’ll figure it out!!
Is this the only error left? You’re almost there!
Try looking at it this way:
(lines with - are your output, + is the desired outcome and ? are the differences)