Created
October 16, 2016 10:04
-
-
Save alexxxmf/0d71be919ad8f6feaea22136ed804eb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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