primeList = lambda n: set([i for i in range(2,n)]) ^ set([i for i in range(2,n) for x in range(2,int(i**0.5)+1) if i%x == 0])
Diff to Previous Revision
--- revision 2 2011-10-31 21:33:21 +++ revision 3 2011-11-05 23:42:37 @@ -1,2 +1,1 @@ -def primeList(n): - return set([i for i in range(2,n)]) ^ set([i for i in range(2,n) for x in range(2,int(i**0.5)+1) if i%x == 0]) +primeList = lambda n: set([i for i in range(2,n)]) ^ set([i for i in range(2,n) for x in range(2,int(i**0.5)+1) if i%x == 0])