Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created October 3, 2018 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/03ec4f0a9bf9e5485719e6d9b787e586 to your computer and use it in GitHub Desktop.
Save codecademydev/03ec4f0a9bf9e5485719e6d9b787e586 to your computer and use it in GitHub Desktop.
Codecademy export
def is_prime(x):
if x >= 2:
for n in range(2, x-1):
if x%n == 0:
return False
print "The number is not prime"
else:
return True
print "The number is prime"
else:
return False
print "The number must be greater than 2"
is_prime(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment