Skip to content

Instantly share code, notes, and snippets.

@AmaxJ
Created January 15, 2015 23:06
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 AmaxJ/57150abee84d49fade0a to your computer and use it in GitHub Desktop.
Save AmaxJ/57150abee84d49fade0a to your computer and use it in GitHub Desktop.
nextPrime
def isPrime(num):
prime = True
for x in range(2, num):
if num % x == 0:
prime = False
return prime
def nextPrime(num):
current = num + 1
while isPrime(current) != True:
current += 1
return current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment