They should have used another keyword. I guess it's too late now :) On Thu, Jul 1, 2010 at 2:48 PM, Ahik Man <[email protected]> wrote:
> What do you think about this code: > > 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' > > > I don't like this 'for - else' trick. IMHO it's confusing and not readable. > > BTW, This code is taken from the python tutorial: > > http://docs.python.org/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops > > > Ahik > > > -- > You received this message because you are subscribed to the Google Groups > "PyWeb-IL" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<pyweb-il%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/pyweb-il?hl=en. > -- -- Ron
_______________________________________________ Python-il mailing list [email protected] http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il
