Maybe it is a stupid question, but i was wondering if you could provide the shortest source to find prime numbers with Python.
I was also wondering how to find prime numbers
Similar to the above, but not as cheeky as Robert King's answer:
from itertools import ifilter, imap
def primes(max=3000):
r = set(); [r.add(n) for n in ifilter(lambda c: all(imap(c.__mod__, r)), xrange(2, max+1))]; return sorted(r)