[Tutor] Prime numbers
ydmt923 at gmail.com
Sat Mar 27 23:08:54 CET 2010
Having a problem finding the first 1000 prime numbers, here is my code:-
while counter <=1000:
for x in range(3,int((n**0.5)),2):
if n%x != 0:
The problem is, it prints 2 and then does nothing, yet if i try and close,
it says program is still running do you want to kill it, is there a way to
do this with lists, i know python has a prime function but i am not going to
use it because i want to solve this problem without 'cheating'.Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor