# What is wrong in this code

I have tried to define a function as per the conditions
all the test case are wrong but when, I tried in ide everything looks normal and fine

``````        def arithmetic_arranger(problems, cond=False):
fa = ""
fb = ""
fc = ""
fd = ""
e = False
for i in problems:
l = len(problems)
if l > 5:
print("Error: Too many problems.")
e = True
break
a, o, b = i.split()
try:
a = int(a)
b = int(b)
except:
print("Error: Numbers must only contain digits.")
e = True
break
if o == "+":
c = a + b
elif o == "-":
c = a - b
else:
print("Error: Operator must be '+' or '-'.")
e = True
break
lc = len(str(c))
la = len(str(a))
lb = len(str(b))
m = max(la, lb)
if m > 4:
print("Error: Numbers cannot be more than four digits.")
e = True
break
fa += "  " + (m - la) * " " + str(a) + "    "
fb += o + " " + (m - lb) * " " + str(b) + "    "
fd += (m + 2) * "-" + "    "
fc += ((m + 2) - lc) * " " + str(c) + "    "
if e is True:
arranged_problems = ""
elif cond:
arranged_problems = fa + "\n" + fb + "\n" + fd + "\n" + fc
else:
arranged_problems = fa + "\n" + fb + "\n" + fd

return arranged_problems
``````

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

Challenge: Arithmetic Formatter

You can also use the â€śpreformatted textâ€ť tool in the editor (`</>`) to add backticks around text.