I'm a bad fan of Nick Parlante teaching style. He has a excellent site that has some exercises to teach Python, and they are backed with unittests. http://codingbat.com/python <http://codingbat.com/python>
On Mon, Jun 11, 2012 at 11:05 AM, brian arb <brianjames...@gmail.com> wrote: > 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. >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor