Learning Python by Mark Lutz & David Ascher If you have any error reports or technical questions, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was updated on January 06, 2003. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: Please see authors' errata page at: http://www.rmi.net/~lutz/errata-lp.html {87} 3rd paragraph, the code example; Mathematically, integers less than 2 are NOT considered prime. Hence, the else statement after the while loop will still print y as prime even if y contains values such as 0 or 1, which are NOT prime! So instead of ... else: pirnt y, 'is prime' It should really be ... else: if x == 1: pirnt y, 'is prime' This is a bug in what the code is supposed to achieve. AUTHOR: Yes, this is true; but I don't think it's worth patching (we'd also then have to explain this odd new test in more details in the text, and it would distract from the point of the example). However, I will add a note in the 2nd Edition about this. This little code snippet demos a Python while loop, and doesn't claim to be a mathematically precise definition of prime. It's also wildly inefficient, but doesn't aim to address better algorithms either. {330} 1st paragraph, line 5; "...L[3:3], the empty insertion point after offset 3" should really be "...L[3:3], the empty insertion point before offset 3" Note it is "before", not "after" AUTHOR: Yes: this is incorrect wording. It should read "at offset 2", not "after offset 3". "Before" doesn't really work here nay more than "after".