Welcome, guest | Sign In | My Account | Store | Cart
n=102
nump = [2] + range(3, n+1, 2) 
for i in range(3, int((n**0.5)+1)): 
    nump = filter(lambda x: x == i or x % i, nump)
 
print nump

Diff to Previous Revision

--- revision 3 2014-08-17 17:39:58
+++ revision 4 2014-09-17 15:34:25
@@ -1,6 +1,6 @@
 n=102
-nump = range(2, n+1) 
-for i in range(2, int((n**0.5)+1)): 
+nump = [2] + range(3, n+1, 2) 
+for i in range(3, int((n**0.5)+1)): 
     nump = filter(lambda x: x == i or x % i, nump)
  
 print nump

History