[Tutor] programming exercise in Python

Alan Gauld alan.gauld at freenet.co.uk
Wed Aug 9 22:45:52 CEST 2006

> it's much more useful to write out the complete test case without 
> preconceptions, without the aid of the code you're trying to test. 
> This works because:

>     * Writing out the test cases first can help in writing the
>       real function.
> Those test cases act as documentation that other people can look at.

Can I echo that.

After I saw your test output I immediately understood how the
function was supposed to work. If you could have posted that
sample input/output data along with the spec before writing
the code we could have been much more helpful - I think... ;-)

Alan G. 

More information about the Tutor mailing list