Forum: Python Jun 3rd, 2007 |
| Replies: 38 Views: 10,384 Thanks
You are right
Must be :
if 0 not in map(lambda x: i % x, myarray[0:int(sqrt(len(myarray)))+1]):
myarray.append(i)
a sqrt(x)+1 must be in test |
Forum: Python Jun 2nd, 2007 |
| Replies: 2 Views: 1,627 My friend
I used to work with eclipse , but didn't satisfy me...
After I worked with Zend Studio ( for PHP ) and WingIde ( for PYTHON ) , it made me learn faster.
IMO wingide is a good choice ,... |
Forum: Python Jun 2nd, 2007 |
| Replies: 38 Views: 10,384 Thanks all for replies
I tested this one , no non-primes there , and x+1 is for the 49 problem :
myarray = [2,3]
from math import sqrt
def prime(x):
for i in xrange(3, x+1,2):
... |
Forum: Python Jun 1st, 2007 |
| Replies: 38 Views: 10,384 How this one compared to the other?
myarray = [2,3]
from math import sqrt
def prime(x):
for i in xrange(3, x,2):
if filter(lambda x: i % x,... |
Forum: Python Jun 1st, 2007 |
| Replies: 7 Views: 2,000 I was thinking of the smallest code
This must go to sqr(x) while checking for being divide by x
So in that situation , this would be faster
Looking forward to see better solution
Good job... |
Forum: Python May 31st, 2007 |
| Replies: 7 Views: 2,000 myarray = [2,3]
def prime(x):
for i in range(3, x,2):
if filter(lambda x: i % x, myarray) == myarray :
myarray.append(i) |
Forum: Python May 31st, 2007 |
| Replies: 38 Views: 10,384 myarray = [2,3]
def prime(x):
for i in range(3, x,2):
if filter(lambda x: i % x, myarray) == myarray :
myarray.append(i) |