Skip to content

Instantly share code, notes, and snippets.

@Ikhiloya
Created October 25, 2018 22:53
Show Gist options
  • Save Ikhiloya/678d678c19cc480d7eeb81e15cd8ad69 to your computer and use it in GitHub Desktop.
Save Ikhiloya/678d678c19cc480d7eeb81e15cd8ad69 to your computer and use it in GitHub Desktop.
Function to check for prime numbers
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