0
code coach code problems: getting right outputs on problems but wrong on some hidden outputs
I am fairly new to sololearn so started with the easy problems; I can get the right shown outputs but on about half the problems I have tried I don't get the hidden outputs. What is the best way to proceed when the outputs are hidden and you don't know what's wrong?
9 Respostas
+ 6
Please
* show your code
* tag the relevant programming language
* mention the task name
+ 6
This not about giving ready-made code. This is about presenting your own attempt so we can understand how you approached the problem and what issues there might be with the code.
If you show your code and mention the task, we can give you hints how to fix it.
If you don't show any code, there's nothing we can do but tell you to read the task description carefully.
+ 5
Each exercise has its own spefic edge cases and restrictions to input and output.
You're just saying that you don't have the habit of asking yourself what cases may be exceptional (if your code applies to all cases) and trying many different inputs.
A careful analysis of the exercise, input and output (creating your own test cases) helps.
There's no surefire way to figure out all of them, I guess. People do their best.
You have to think of exceptions to your rule. The edge/corner cases. What does your code not cover?
People just ask these questions to themselves.
You can sometimes use a try block but while not all codes lead to errors, your output might still be wrong.
+ 2
Think of any exception case that your code cannot deal with. By Murphy law, when something can go wrong, error must occur.
+ 1
Thanks for reply
I am using python
I don't want the solutions just how to proceed when the hidden tasks show up wrong but the shown tasks give the right outcome
I have tried the first 8 easy problems
+ 1
without the steps you were advised to do above and a sample code that gives you an error will not be able to help you. its like asking a plumber to fix you a leak of water in an apartment from a burst pipe, not letting it go to your apartment, but holding it behind a closed door outside
+ 1
Thanks all
I will follow adpatrick suggestions and see if I can sort the code for all exceptions
I feel I should b able to sort things out now the problems are very easy 🙂
0
Hi gues👋