> hmm... interesting
>
> here is another way you can find prime 
> numbershttp://love-python.blogspot.com/2008/02/find-prime-number-upto-100-nu...
>

Sadly that is pretty slow though...

If you don't mind readability you can make the example I gave into
five lines.

def p(_):
 if _<3:return[2]if _==2 else[]
 a,b,b[1]=int(_**0.5)+1,range(_+1),0
 for c in xrange(2,a):
  if b[c]:b[c*c:_+1:c]=[0]*((_/c-c)+1)
 return[_ for _ in b if _]

But then, I would have to kill you...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to