On Wed, 27 Nov 2013 17:08:11 +0100, Rafael Knuth <[email protected]> wrote:
    for x in range(2, n):
        if n % x == 0:
            print(n, 'equals', x, '*', n//x)




#3 Round:
n = 4
x = 3

When n is 4, the inner loop will test 2, then 3. But since n% x is zero for values 4 and 2, it will print, then break. Because of the break, it won't even get to 3.

--
DaveA

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to