New submission from AmirHossein Haji Mohammad Sadegh <amirross...@gmail.com>:

It's not wrong but in the example for "continue" in the tutorial, the code 
prints "Found an even number" for even numbers and "Found a number" for odd 
numbers. Maybe it would be better if we print "Found an odd number" for odd 
numbers. Like this:

for num in range(2, 10):
    if num % 2 == 0:
        print("Found an even number", num)
        continue
    print("Found an odd number", num)

Found an even number 2
Found an odd number 3
Found an even number 4
Found an odd number 5
Found an even number 6
Found an odd number 7
Found an even number 8
Found an odd number 9

----------
assignee: docs@python
components: Documentation
messages: 376834
nosy: amirrossein, docs@python
priority: normal
severity: normal
status: open
title: Revise example of "continue" in the tutorial documentation
type: performance

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41776>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to