Welcome, guest | Sign In | My Account | Store | Cart
import math

n=102
nump = range(2, n+1) 
for i in range(2, int(math.sqrt(n))+1): 
    nump = filter(lambda x: x == i or x % i, nump)
 
print nump

Diff to Previous Revision

--- revision 1 2014-08-17 17:31:19
+++ revision 2 2014-08-17 17:33:17
@@ -1,3 +1,5 @@
+import math
+
 n=102
 nump = range(2, n+1) 
 for i in range(2, int(math.sqrt(n))+1): 

History