basic python question about for loop

Terry Reedy tjreedy at udel.edu
Wed Apr 9 17:40:14 EDT 2008


|So what is n and x in the first iteration?  Sorry.  I'm trying.

When n == 2, the inner loop executes 0 times (the length of range(2,n)) and 
then falls thru to the else clause, printing the correct answer. 






More information about the Python-list mailing list