Need Help on Build an Arithmetic Formatter Project

Hello There. I have completed the code and getting the correct output. But still the test is failed i checked the formatting and seems like everything is ok to me. Please Help me if possible. My code is given below.

def arithmetic_arranger(problems, show_answers=True):
    first=""
    second=""
    lines=""
    res=""
    if len(problems)>5:
        return "Error: Too many problems."
    else:
          for problem in problems:
               print(problem)
               upper,operator,lower=problem.split()
               
               print(upper,operator,lower)
               if not upper.isdigit() or not lower.isdigit():
                    return "Error: Numbers must only contain digits."
               else:
                    if len(upper) > 4 or len(lower) > 4:
                         return "Error: Numbers cannot be more than four digits."
               if operator != "+" and operator != "-":
                         return "Error: Operator must be '+' or '-'."
               elif operator == "+" :
                         sol = str(int(upper) + int(lower))

               elif operator == "-" :
                         sol = str(int(upper) - int(lower))
               
               
               length = max(len(upper), len(lower)) + 2
               top=str(upper).rjust(length)
               bottom=operator+str(lower).rjust(length-1)
               line = ""
               result = str(sol.rjust(length))
               for _ in range(length):
                    line += "-" 
               if problem!=problems[-1]:     
                    first +=top+'    '
                    second +=bottom+'    '
                    lines +=line+'    '
                    res +=result+'    '     
               else:
                       first +=top    
                       second +=bottom
                       lines +=line
                       res +=result
          if (show_answers):
                    operations= first+"\n"+second+"\n"+lines+"\n"+res
          else:
                    operations= first+"\n"+second+"\n"+lines
          
          return operations
                    
print(f'\n{arithmetic_arranger(["3 + 855", "988 + 40"])}')

Please check the browser console output and then if you need help with it, copy and paste it here in your reply. (Use f12 to view it)

Done that. But Found nothing, only the first 4 test is failing. THough i m using firefox for browser and the console is showing nothing much o guess.

Can you copy the output here? The console I am talking about is the browser console btw not the one you see by default.

Found the solution. I just had to make the show_solution False.thanks