Last active
February 2, 2017 17:40
-
-
Save blbradley/b505b2ad0a70755b399d17c8b7cce99a to your computer and use it in GitHub Desktop.
ardnew wants to see my primes solution and help
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
from math import floor, ceil, sqrt | |
p = int(input().strip()) | |
for a0 in range(p): | |
n = int(input().strip()) | |
if n == 1: | |
print('Not prime') | |
continue | |
for d in range(2, int(sqrt(n))+1): | |
if n % d == 0: | |
print('Not prime') | |
break | |
else: | |
print('Prime') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment