You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]: forninrange(20):
# check if n is evenifn%2==0:
continueprint(n, end=' ')
135791113151719
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.
Activity
szafranek commentedon 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.