[New-bugs-announce] [issue41776] Revise example of "continue" in the tutorial documentation
AmirHossein Haji Mohammad Sadegh
report at bugs.python.org
Sun Sep 13 07:59:02 EDT 2020
New submission from AmirHossein Haji Mohammad Sadegh <amirrossein at 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 at python
components: Documentation
messages: 376834
nosy: amirrossein, docs at python
priority: normal
severity: normal
status: open
title: Revise example of "continue" in the tutorial documentation
type: performance
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41776>
_______________________________________
More information about the New-bugs-announce
mailing list