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

Diff to Previous Revision

--- revision 2 2014-08-17 17:33:17
+++ revision 3 2014-08-17 17:39:58
@@ -1,8 +1,6 @@
-import math
-
 n=102
 nump = range(2, n+1) 
-for i in range(2, int(math.sqrt(n))+1): 
+for i in range(2, int((n**0.5)+1)): 
     nump = filter(lambda x: x == i or x % i, nump)
  
 print nump

History