Created
September 25, 2013 14:23
-
-
Save ProProgrammer/6700357 to your computer and use it in GitHub Desktop.
This function called takes a number as input and returns the boolean True if its is a prime number and False otherwise.
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 is_prime(x): | |
if x < 2: | |
return False | |
for s in range(2,x): | |
if x % s == 0: | |
return False | |
else: | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment