Skip to content

Instantly share code, notes, and snippets.

@blbradley
Last active February 2, 2017 17:40
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 blbradley/b505b2ad0a70755b399d17c8b7cce99a to your computer and use it in GitHub Desktop.
Save blbradley/b505b2ad0a70755b399d17c8b7cce99a to your computer and use it in GitHub Desktop.
ardnew wants to see my primes solution and help
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