This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年03月08日 00:40 by Kyte999, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg63374 - (view) | Author: k-e-n (Kyte999) | Date: 2008年03月08日 00:40 | |
The code from section 4.4 of the tutorial follows. This code does not produce the output shown. Adding a final break statement will fix this. >>> for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print n, 'equals', x, '*', n/x ... break ... else: ... # loop fell through without finding a factor ... print n, 'is a prime number' ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 |
|||
| msg63386 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2008年03月08日 09:47 | |
Sorry, but I don't see a mismatch between code and output. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:31 | admin | set | github: 46510 |
| 2008年03月08日 09:47:21 | georg.brandl | set | status: open -> closed resolution: not a bug messages: + msg63386 |
| 2008年03月08日 01:42:26 | rhettinger | set | assignee: georg.brandl -> rhettinger nosy: + rhettinger |
| 2008年03月08日 00:40:07 | Kyte999 | create | |