Please look at the example code in the following Python 3.0 documentation/tutorial: http://docs.python.org/3.0/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops The line 4 has a little fix to be made: from ... print(n, 'equals', x, '*', n//x) to ... print(n, 'equals', x, '*', n/x) You probably noticed that n//x was proposed to be fixed to n/x. Please note that this is Python 3.0 code. It's a small fix so I hope you won't mind to fix this.
For Python 2.x that example code is fine, but Python 3.0 has this switched now. Please read http://www.python.org/dev/peps/pep-0238/. True division in Python 3.0 is done with one division operator. Please fix that code example to reflect that.
> For Python 2.x that example code is fine, but Python 3.0 has this > switched now. Please read http://www.python.org/dev/peps/pep-0238/. > > True division in Python 3.0 is done with one division operator. Please > fix that code example to reflect that. I still don't understand. The example doesn't, and shouldn't, use true division. It does, and should, use floor division, to display the divisors of a non-prime.
Retro, the code is correct as it stands. Floor division is intended (int // int --> int). I think you've misunderstood true division where the / operator used to mean floor division when supplied with integer arguments but now returns a float instead.