Skip to content

Instantly share code, notes, and snippets.

@arkag
Created November 6, 2015 03:32
Show Gist options
  • Select an option

  • Save arkag/38e75199549764085305 to your computer and use it in GitHub Desktop.

Select an option

Save arkag/38e75199549764085305 to your computer and use it in GitHub Desktop.
It finds prime numbers...
num = int(input("How many primes would you like?\n"))
n = 0
p = 0
primes = [ ]
while p < num:
if(n % 2 != 0 and n % 3 != 0 and n % 4 != 0 and n % 5 != 0):
primes.append(n)
p+=1
n+=1
print("Here are your prime numbers:\n" + str(primes))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment