Hey I can’t seem to get this right.

The output looks Identical to me when I do a == test its True. But and “is” is False. Sorry I really don’t know what I’ve done wrong.

Please see code:

def arithmetic_arranger(problems):

arranged_problems = str()

# pulling equation list

if len(problems) <= 2:

sums = problems[0]

else:

sums = problems

# Too many problem error

if len(sums) > 5:

print(“Error: Too many problems.”)

exit()

```
l1 = str()
l2 = str()
l3 = str()
l4 = str()
f = 0
for x in sums:
asp = 0
a = 0
alen = 0
bsp = 0
b = 0
blen = 0
c = 0
asp = x.find(' ')
a = x[0:asp]
alen = len(a)
bsp = x.find(' ', asp + 1)
b = x[bsp + 1:len(x)]
blen = len(b)
c = x[asp + 1:bsp]
if a.isdecimal() is not True:
print("Error: Numbers must only contain digits.")
exit()
if b.isdecimal() is not True:
print("Error: Numbers must only contain digits.")
exit()
if c == '+':
d = int(int(a) + int(b))
elif c == '-':
d = int(int(a) - int(b))
else:
print("Error: Operator must be '+' or '-'.")
exit()
if max(alen, blen) > 4:
print("Error: Numbers cannot be more than four digits.")
exit()
dlen = len(str(d))
d = str(d)
dep = max(alen + 2, blen + 2, dlen + 1)
e = str("-" * dep)
if f < 1:
l1 = l1 + a.rjust(dep, " ")
l2 = l2 + c + b.rjust(dep - 1, " ")
l3 = l3 + e.rjust(dep, " ")
l4 = l4 + d.rjust(dep, " ")
f = f + 1
else:
l1 = l1 + a.rjust(4 + dep, " ")
l2 = l2 + c.rjust(5," ") + b.rjust(dep - 1, " ")
l3 = l3 + e.rjust(4 + dep, " ")
l4 = l4 + d.rjust(4 + dep, " ")
if True in problems:
arranged_problems = l1 + '\n' + l2 + '\n' + l3 + '\n' + l4
else:
arranged_problems = l1 + '\n' + l2 + '\n' + l3
return arranged_problems
```