**Tell us what’s happening:**

Describe your issue in detail here.

**Your code so far**

```
import re
def arithmetic_arranger(problems, solve = False):
if (len(problems) > 5):
return "Error: Too many problems."
first = ""
second = ""
lines = ""
sumx = ""
string = ""
for problem in problem :
if(re.search("[^\s0-9.+-]",problem)):
if(re.search("[/]", problem) or re.search("(*)", problem)):
return "Error: operator must be '+' or '-'."
return"error: Numbers mustonly contain digits."
firstNumber = problem.split(" ")[0]
operator = problem.split(" ")[1]
secondNumber = problem.split(" ")[2]
if(len(firstNumber) >= 5 or len (secondNumber) >= 5 ):
return "Error: Numbers must only contain digits."
sum = ""
if (operator == "+"):
sum = str(int(firstNumber) + int(secondNumber))
elif(operator == "-"):
sum = str(int(firstNumber) - int(secondNumber))
length = max(len(firstNumber), len(secondNumber)) + 2
top = str(firstNumber).rjust(length)
bottom = operator + str(secondNumber).rjust(length = 1)
lines = ""
res = str(sum).rjust(length)
for s in range (length):
line += "-"
if problem != problems[-1]:
first += top + " "
second += bottom + " "
lines += line + " "
sumx += res + " "
else:
first += top
second += bottom
lines += line
sumx += res
if solve:
string = first + "\n" + second + "\n"+ lines + "\n"+ sumx
else:
string = first + "\n" + second + "\n"+ lines
return string
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36 Edg/96.0.1054.53`

**Challenge:** Arithmetic Formatter

**Link to the challenge:**