Stuck with the Arithmetic formatter

Tell us what’s happening:
So I can see that the first line is off by 2 spaces, but subtracting that from the spacing or maxLen doesn’t seem to change anything, Am I overlooking something? is the formatting code just comletely wrong? I always seem to get that excess spacing. Thanks for any help!

Your code so far
link : https://repl.it/repls/DelectableSmoggyForms#arithmetic_arranger.py

Challenge: Arithmetic Formatter

Link to the challenge:

Hello! Welcome to the community :partying_face:!

You have some logical and indentation problems (in python is essential to correctly indent your code) :stuck_out_tongue::

  1. You should be checking that the numbers are greater than 4 (not greater or equal).
  2. On the last lines, where you create the arranged_problems, it’s indented to be inside the loop, hence you’re returning after the first problem.
  3. You have a problem with one regex. This is the output of the result of calling your function: 32<re.Match object; span=(3, 4), match='+'>698-----32<re.Match object; span=(3, 4), match='+'>698, which is wrong.

Try to figure out the problems :slight_smile:.

1 Like