Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo: even instead of odd? #14

Open
szafranek opened this issue Sep 24, 2017 · 1 comment
Open

Typo: even instead of odd? #14

szafranek opened this issue Sep 24, 2017 · 1 comment

Comments

@szafranek
Copy link

On page 40 there's a code listing printing a sequence of odd numbers with the following introduction:

Here is an example of using continue to print a string of even numbers. In this case, the result could be accomplished just as well with an if-else statement, but sometimes the continue statement can be a more convenient way to express the idea you have in mind:

In [7]: for n in range(20):
           # check if n is even
           if n % 2 == 0:
               continue
           print(n, end=' ')
1 3 5 7 9 11 13 15 17 19

Shouldn't the intro paragraph say odd instead of even?

Thank you for writing this book and publishing it for free! I really enjoy it and recommend it to my colleagues who have to dip their toes in some Python code.

@szafranek
Copy link
Author

szafranek commented Sep 28, 2017

I checked book's source and this is already fixed. However, the PDF uploaded to O'Reilly site and linked from the README still includes the mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant