Arithmetic Formatter doesn't return error message when run multiple tests

Tell us what’s happening:

When I run my code separately, the error message shows up fine.

However, when I run multiple lines of code, error messages don’t show up properly. The messages from test 1 and 2 don’t show up as below.

Thank you very much.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.51 Safari/537.36

Challenge: Arithmetic Formatter

Link to the challenge:

I think it is showing last executed value, as the first two functions do not execute a print statement, and the third one yes instead (though note that you should always return the value)

Thanks for the insight, I got a counter-intuitive solution. But I am pretty sure there is a way more efficient way of returning the error messages.

I would be thankful if you can offer me some suggestions on this matter.

You should not use print. The instructions are to return the error messages.

If you want to see what each function call does, then you can wrap your function calls in a print.

Normally, you would raise an error, which would stop execution of your code.

Thanks for all the replies. I have solved it. Much appreciated

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.