Skip to content

Instantly share code, notes, and snippets.

@alexxxmf
Created October 16, 2016 10:04
Show Gist options
  • Save alexxxmf/0d71be919ad8f6feaea22136ed804eb9 to your computer and use it in GitHub Desktop.
Save alexxxmf/0d71be919ad8f6feaea22136ed804eb9 to your computer and use it in GitHub Desktop.
def is_prime(n):
prime = False
for divisor in range(2, n):
if n % divisor == 0:
return prime
else:
continue
prime = True
return prime
def next_prime(n):
prime_found = False
while prime_found == False:
n = n + 1
if is_prime(n) == True:
prime_found == True
return n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment