Advertisement
Joeytje50

Untitled

Dec 7th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. def primes(max_n):
  2.     primes = [2]
  3.     for i in xrange(3,max_n,2):
  4.         for n in primes:
  5.             if i%n==0:
  6.                 break
  7.         else:
  8.             primes.append(i)
  9. print primes(1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement