 # HELP! Arithmetic formatter, don´t know how to fix it

Hello, I’ve been working with this problem on my IDE and it function the right way, but when i put my code in the test it doesn`t pass two test. I think my problem is that for some reason when i print the output it prints a 'None' next to the right output, but i don`t know how to fix it. Does anyone knows who to fix it? thanks, here is my code:

``````def arithmetic_arranger(problems, answer = False):

if len(problems) > 5:
return('Error: Too many problems.')

firsts, operators, seconds, lengths, answers = [], [], [], [], []

for op in problems:
s_op = op.split()
if len(s_op) > 4 or len(s_op) > 4:
return('Error: Numbers cannot be more than four digits.')
else:
firsts.append(s_op)
operators.append(s_op)
seconds.append(s_op)

for i in range(len(problems)):
if not firsts[i].isdigit() or not seconds[i].isdigit():
return('Error: Numbers must only contain digits.')

valids_op =['+', '-']
op_status = [-1 for i in operators if i not in valids_op]
if -1 in op_status:
return('''Error: Operator must be '+' or '-'.''')

for x, y in zip(firsts, seconds):
lengths.append(max((len(x), len(y))) + 2)

for i in range(len(problems)):
if operators[i] == '+':
if operators[i] == '-':

for i in range(len(problems)):
if i < len(problems) - 1:
print(firsts[i].rjust(lengths[i]), end='    ')
else:
print(firsts[i].rjust(lengths[i]), end='')
print('')
for i in range(len(problems)):
if i < len(problems) - 1:
print(f'{operators[i].ljust(lengths[i] - len(seconds[i]) - 1)} {seconds[i].rjust(1)}', end='    ')
else:
print(f'{operators[i].ljust(lengths[i] - len(seconds[i]) - 1)} {seconds[i].rjust(1)}', end='')
print('')
for i in range(len(problems)):
if i < len(problems) - 1:
print ('-' * lengths[i], end='    ')
else:
print('-' * lengths[i], end='')
You need to `return` a string with the correct information, not `print` the data out.