Advertisement
Guest User

prime

a guest
May 1st, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. from math import*
  2. x=3
  3. count=1
  4. listOfprimes=[2]
  5.  
  6. while count < 1000:
  7. is_prime = True
  8.  
  9. for y in range (2,int(sqrt(x)+1)):
  10. if x%y == 0:
  11. is_prime = False
  12.  
  13.  
  14. if is_prime:
  15. listOfprimes.append(x)
  16. count+=1
  17. x +=2
  18. print listOfprimes[-1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement