Hi guys,

I’m having some troubles completing this first exercise. The thing is I wrote the code first in my text editor and it runs pretty well (is messy I know, and I still have some problems with the right-align). Yet Replit keeps telling me that my code doesn’t work in terms of properly sending the error’s messages. You know what might be wrong here? Once again I’m sorry on how messy the code is, I sure need to change some other things because how much code I wrote.

```
numberProblems = len(problems)
if numberProblems < 5:
for i in range(len(problems)):
newOperation = problems[i].split()
try:
int(newOperation[0]) and int(newOperation[2])
if len(newOperation[0]) < 5 and len(newOperation[2]) < 5:
if newOperation[1] == "+" or newOperation[1] == "-":
isValid = isValid + 1
else:
print("Error: Operator must be '+' or '-'.")
break
else:
print("Error: Numbers cannot be more than four digits.")
break
except:
print("Error: Numbers must contain digits.")
quit()
else:
print("Error: Too many problems.")
if isValid == numberProblems:
for i in range(len(problems)):
newOperation = problems[i].split()
firstOperand = f"{newOperation[0]:>5}"
print(firstOperand)
secondOperand = f"{newOperation[2]:>3}"
print(newOperation[1], secondOperand)
line = ""
if len(newOperation[0]) > len(newOperation[2]):
for y in range(len(newOperation[0]) + 2):
line = line + "-"
else:
for y in range(len(newOperation[2]) + 2):
line = line + "-"
print(line)
if newOperation[1] == "+":
result = int(newOperation[0]) + int(newOperation[2])
finalResult = f"{result:>5}"
print(finalResult)
else:
result = int(newOperation[0]) - int(newOperation[2])
finalResult = f"{result:>5}"
print(finalResult)
whiteSpace = "\n"
print(3*whiteSpace)
arithmetic_arranger(["32 + 698", "3815 - 2", "45 + 43", "123 + 49"])
**Your browser information:**
User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 OPR/78.0.4093.147</code>
**Challenge:** Arithmetic Formatter
**Link to the challenge:**
https://www.freecodecamp.org/learn/scientific-computing-with-python/scientific-computing-with-python-projects/arithmetic-formatter
```