Hey all,
I am new to all of this, from coding to using tools like replit. I have figured out the arithmetic arranger and it works flawlessly in my pycharm environment but I can’t get it to work or replit. Likely it has something to do with how replit is handling the automated input of the problems into my code.
Any suggestions on how to get those inputs into a variable in my code?
Does running main.py file, or test file with pytest shows in pycharm that tests are passing?
This project isn’t expected to handle getting input from user on it own. It’s assumed that function will accept certain arguments, but where from these values are originating (keyboard, file, some randomness, etc.) is not a part of, or concern of the project.
I guess I should have been more clear, I’m not running the tests from the replit code to check if I am passing in pycharm, rather I’m just putting in the values I see there manually. I am unsure how to format my code to accept the inputs from test_module.py
The error I am getting is something to do with their container it seems
python main.py
Traceback (most recent call last):
File “main.py”, line 4, in
from arithmetic_arranger import arithmetic_arranger
File “/home/runner/boilerplate-arithmetic-formatter-1/arithmetic_arranger.py”, line 2
def arithmetic_arranger(problem)
^
SyntaxError: invalid syntax
exit status 1
The tests on repl are just calling the functions… Unless you changed the function signatures, that isn’t the issue. I agree that seeing the code is necessary.
I think that because I am getting an error on that line when I run the code. I didn’t change the function signatures (at least as far as I know, i’m not entirely sure what that means tbh).
Your return statements are pretty complicated, but it looks Iike you are trying to return the solutions separately from the rest of the result. That can’t work. A function can only return once and then it immediately stops.
In the following line, what exactly is happening with the solutions bit?
def arithmetic_arranger(problems, solutions = True):
I can get my program to toggle my solutions on and off in pycharm by setting a manual variable to t/f but I guess I don’t understand how to manipulate/handle that out of the above line?