Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def PrimeNumber():
- prime = True
- primeCount = 0
- count = 1
- while (primeCount < 1000):
- for i in range(2,count):
- if count % i != 0:
- div = 3
- while div < (count / 2):
- if count % div == 0:
- prime = False
- break
- elif count % div != 0:
- prime = True
- div += 2
- break
- elif count % i == 0:
- prime = False
- break
- if prime == True:
- primeCount += 1
- count += 2
- #While it isnt ideal, it works
- print str(count-2) + ' is a prime number'
- PrimeNumber()
Advertisement
Add Comment
Please, Sign In to add comment