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),2): 
    nump = filter(lambda x: x == i or x % i, nump)
 
print nump

Diff to Previous Revision

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

History