Skip to content

Instantly share code, notes, and snippets.

@Echocage
Created January 22, 2015 01:32
Show Gist options
  • Save Echocage/9d2f4760fdb5e424bb06 to your computer and use it in GitHub Desktop.
Save Echocage/9d2f4760fdb5e424bb06 to your computer and use it in GitHub Desktop.
print("Prime #s from 1 to 1000")
def is_prime(n):
for i in range(3, n):
if n % i == 0:
return False
return True
for number in range(1000):
if is_prime(number):
print('{} is prime'.format(number))
input('Press any key to quit')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment