Hello i hope you are doing verry well,

i have a problem concerning the arrithmetic arranger problem in scientific computing with python . In fact, i have written my code in my own pyhton IDE on my computer and i have copied all the tests that are given the replit website to see if i have fully done the job. And when i test my code on my own IDE it works very well but when i paste my code in replit and test it on replit i have an issue with 2 tests wich are (test_arrangement, and test_solutions. The problem is that my code works very well on my own IDE .

Please help me, I would be very thankfull.

my code is as follows:

```
#function that detects the first space in a string
def detect_first_space(l):
inter=0
for i in l:
if i==" ":
inter=l.index(i)
return inter;
else:
None;
#function that compares two strings and renturns the index of the longest string in inter in arithmetic_arranger
def compar_str(m):
if len(m[0])>len(m[2]):
return 0;
else:
return 2;
def arithmetic_arranger(problems,result=False):
if not len(problems)<=5:
return "Error: Too many problems."
inter=[]
r=""
for i in problems:
space_index=detect_first_space(i)
inter.append([i[0:space_index],i[space_index+1],i[space_index+3:]])
for j in inter:
try :
(int(j[0]) and int(j[2]))
except:
return "Error: Numbers must only contain digits."
if not(j[1]=="+" or j[1]=="-" ):
return "Error: Operator must be '+' or '-'."
if not( len(j[0])<=4 and len(j[2])<=4):
return "Error: Numbers cannot be more than four digits."
j.append(compar_str(j))
for j in inter:
r+=" "
if j[3]==0 :
r=r+ j[0]
else:
r=r+" "*(len(j[2])-len(j[0]))
r=r+ j[0]
r+= " "
r+="\n"
for j in inter :
r=r+j[1]+" "
if j[3]==0 :
r=r+" "*(len(j[0])-len(j[2]))
r=r+j[2]
else:
r=r+j[2]
r=r+" "
r=r+"\n"
for j in inter:
r=r+"-"*(2+len(j[j[3]]))
r=r+" "
if result==True:
r=r+"\n"
for j in inter:
if j[1]=="+":
x=int(j[0])+int(j[2])
else:
x=int(j[0])-int(j[2])
x=str(x)
if len(x)<(len(j[j[3]])+2):
r=r+" "*(2+len(j[j[3]])-len(x))
r=r+x
else:
r=r+x
r=r+" "
return r
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0`

.

**Challenge:** Arithmetic Formatter

**Link to the challenge:**