Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Problem set 1a
- #Name: ###
- #Time: 8:15 -
- prime_count = 1
- test_no = 3
- test_divisor = 2
- while prime_count < 1000:
- if not test_no % test_divisor == 0:
- #print 'divisor: ', test_divisor
- if test_divisor < (test_no / 2) :
- test_divisor = test_divisor + 1
- else:
- # prime number
- print test_no
- test_no = test_no + 2
- test_divisor = 2
- prime_count = prime_count + 1
- else:
- test_no = test_no + 2
Advertisement
Add Comment
Please, Sign In to add comment