Created
January 15, 2015 23:06
-
-
Save AmaxJ/57150abee84d49fade0a to your computer and use it in GitHub Desktop.
nextPrime
This file contains 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 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