New submission from k-e-n: 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 ---------- assignee: georg.brandl components: Documentation messages: 63374 nosy: Kyte999, georg.brandl severity: minor status: open title: typo in tutorial section 4.4 - final break statement is missing versions: Python 2.5 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2257> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com