Created
October 25, 2018 22:53
-
-
Save Ikhiloya/678d678c19cc480d7eeb81e15cd8ad69 to your computer and use it in GitHub Desktop.
Function to check for prime numbers
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(x): | |
if(x < 2 ): | |
return False | |
if(x == 2): | |
return True | |
for n in range(2, x): | |
if(x % n == 0): | |
return False | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment