[Python-il] [pyweb-il:1049] Python coding question
ron.reiter at gmail.com
Thu Jul 1 14:51:28 IDT 2010
They should have used another keyword.
I guess it's too late now :)
On Thu, Jul 1, 2010 at 2:48 PM, Ahik Man <ahik.man at gmail.com> 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:
> You received this message because you are subscribed to the Google Groups
> "PyWeb-IL" group.
> To post to this group, send email to pyweb-il at googlegroups.com.
> To unsubscribe from this group, send email to
> pyweb-il+unsubscribe at googlegroups.com<pyweb-il%2Bunsubscribe at googlegroups.com>
> For more options, visit this group at
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-il