Skip to content

Instantly share code, notes, and snippets.

@Bablzz
Last active October 23, 2019 11:24
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 Bablzz/288589c512e71452874d683b0824c83a to your computer and use it in GitHub Desktop.
Save Bablzz/288589c512e71452874d683b0824c83a to your computer and use it in GitHub Desktop.
Check if digit is simple
def is_simple(digit):
for i in range(2, digit - 1):
if ((digit % i) == 0):
return False
else:
return True
print(is_simple(72)) # False
print(is_simple(73)) # True
print(is_simple(71)) # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment