Skip to content

Instantly share code, notes, and snippets.

@ianling
Created January 27, 2016 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianling/096202d499d61ecf157d to your computer and use it in GitHub Desktop.
Save ianling/096202d499d61ecf157d to your computer and use it in GitHub Desktop.
print 2 # ...
i = 3
while True:
divisorMax = (i/2)
prime = True
for divisor in range(3,divisorMax,2):
if i % divisor == 0:
prime = False
break
if prime:
print i
i += 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment