Your code ran but scored 0
Run checks only the sample tests. Your mark comes from every test, hidden ones included, after you hand in. Code that passes the samples can still fail every hidden test.
Check these on your result
- Open Tests, then Results, and open the test.
- Open the problem and read how many tests passed. 0 passed gives 0 for the code.
- A failed test that is not hidden shows the input, what was expected and what you returned. Compare them line by line.
- If the problem says Not attempted, or explanation only, no code, no code was saved for it when the test was handed in.
- If it says Being marked, marking has not finished. No zero is counted yet.
The usual reasons
- Extra words in the output, such as Enter a number or Answer is. The tests compare the printed output only, so print exactly what the problem asks.
- Reading input in a different shape from the problem's. Read it exactly as the problem describes.
- A hard-coded answer for the sample. Hidden tests use other inputs.
- A crash or a time limit on bigger inputs. The result names the kind of failure.
- Spaces and blank lines at the ends do not matter. Words and numbers do.
In practice
- A practice problem gives XP, not marks. It counts as solved once every test passes, sample and hidden.
- If some tests fail, the message says how many passed, for example 3 of 5 passed. Fix the failing ones and submit again.
- See your practice code will not run for each message.
Did this answer your question?