[Tutor] properties beginner M Dawson book

brian arb brianjamesarb at gmail.com
Mon Jun 11 17:05:51 CEST 2012


I would look into pylint, Python source code looking for bugs and signs of
poor quality.


> There are, unfortunately, no answers nor examples of good and bad code.
>  Honestly I don’t want to “cheat” but I have to teach Python to some young
> students in September, using this book, and I want all the responses to any
> doubts they have ready .....
>
>

> Here’s something specific:
> chapter 8 challenge 2:  “ Write a program that simulates a television by
> creating it as an object. The user should be able to enter a channel number
> and raise or lower the volume.  Make sure that the channel number and
> volume level stay within valid ranges.”


Highly recommend writing unittest, each unit test sends a specific input to
a method and verifies that the method returns the expected value, or takes
the expected action. Unit tests prove that the code you are testing does in
fact do what you expect it to do.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120611/15fa675c/attachment.html>


More information about the Tutor mailing list